summaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/autotest/puppet_rspec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/lib/autotest/puppet_rspec.rb b/spec/lib/autotest/puppet_rspec.rb
index e7de8b615..8536f3912 100644
--- a/spec/lib/autotest/puppet_rspec.rb
+++ b/spec/lib/autotest/puppet_rspec.rb
@@ -5,9 +5,42 @@ class Autotest::PuppetRspec < Autotest::Rspec
def initialize # :nodoc:
super
@test_mappings = {
+ # the libraries under lib/puppet
+ %r%^lib/puppet/(.*)\.rb$% => proc { |filename, m|
+ files_matching %r!spec/(unit|integration)/#{m[1]}.rb!
+ },
+
+ # the actual spec files themselves
%r%^spec/(unit|integration)/.*\.rb$% => proc { |filename, _|
filename
},
+
+ # force a complete re-run for all of these:
+
+ # main puppet lib
+ %r!^lib/puppet\.rb$! => proc { |filename, _|
+ files_matching %r!spec/(unit|integration)/.*\.rb!
+ },
+
+ # the spec_helper
+ %r!^spec/spec_helper\.rb$! => proc { |filename, _|
+ files_matching %r!spec/(unit|integration)/.*\.rb!
+ },
+
+ # the puppet test libraries
+ %r!^test/lib/puppettest/.*! => proc { |filename, _|
+ files_matching %r!spec/(unit|integration)/.*\.rb!
+ },
+
+ # the puppet spec libraries
+ %r!^spec/lib/spec.*! => proc { |filename, _|
+ files_matching %r!spec/(unit|integration)/.*\.rb!
+ },
+
+ # the monkey patches for rspec
+ %r!^spec/lib/monkey_patches/.*! => proc { |filename, _|
+ files_matching %r!spec/(unit|integration)/.*\.rb!
+ },
}
end
end