aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/puppet_spec/files.rb8
-rw-r--r--spec/shared_behaviours/all_parsedfile_providers.rb2
-rw-r--r--spec/spec_helper.rb13
3 files changed, 18 insertions, 5 deletions
diff --git a/spec/lib/puppet_spec/files.rb b/spec/lib/puppet_spec/files.rb
index 5fef530..8715e09 100644
--- a/spec/lib/puppet_spec/files.rb
+++ b/spec/lib/puppet_spec/files.rb
@@ -10,10 +10,10 @@ module PuppetSpec::Files
def self.cleanup
until @global_tempfiles.empty?
path = @global_tempfiles.pop
- begin
- Dir.unstub(:entries)
- FileUtils.rm_rf path, secure: true
- end
+
+ Dir.unstub(:entries)
+ FileUtils.rm_rf path, secure: true
+
end
end
diff --git a/spec/shared_behaviours/all_parsedfile_providers.rb b/spec/shared_behaviours/all_parsedfile_providers.rb
index 1701fe3..321cd86 100644
--- a/spec/shared_behaviours/all_parsedfile_providers.rb
+++ b/spec/shared_behaviours/all_parsedfile_providers.rb
@@ -4,7 +4,7 @@ shared_examples_for 'all parsedfile providers' do |provider, *files|
end
files.flatten.each do |file|
- it "should rewrite #{file} reasonably unchanged" do
+ it "rewrites #{file} reasonably unchanged" do
allow(provider).to receive(:default_target).and_return(file)
provider.prefetch
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e92dced..9b1fa6f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -42,10 +42,23 @@ RSpec.configure do |c|
# set to strictest setting for testing
# by default Puppet runs at warning level
Puppet.settings[:strict] = :warning
+ Puppet.settings[:strict_variables] = true
end
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
c.after(:suite) do
end
+
+ # Filter backtrace noise
+ backtrace_exclusion_patterns = [
+ %r{spec_helper},
+ %r{gems},
+ ]
+
+ if c.respond_to?(:backtrace_exclusion_patterns)
+ c.backtrace_exclusion_patterns = backtrace_exclusion_patterns
+ elsif c.respond_to?(:backtrace_clean_patterns)
+ c.backtrace_clean_patterns = backtrace_exclusion_patterns
+ end
end
# Ensures that a module is defined