diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-12 22:11:40 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-12 22:11:40 -0600 |
commit | fa1924eb04a2d6600349eddf13e1f3e62b45d6ce (patch) | |
tree | 978aa0e92812f5854978048162c6e2ab752dad72 /spec/lib/autotest/puppet_rspec.rb | |
parent | a535cbbe148802c0afe62cd2d5b29d0768b3a0f0 (diff) | |
parent | 72510bfaa65e97f4eaaf246ef8f1c155716967b6 (diff) | |
download | puppet-fa1924eb04a2d6600349eddf13e1f3e62b45d6ce.tar.gz puppet-fa1924eb04a2d6600349eddf13e1f3e62b45d6ce.tar.xz puppet-fa1924eb04a2d6600349eddf13e1f3e62b45d6ce.zip |
Merge branch 'master' of ssh://reductivelabs.com/opt/rl/git/puppet-luke
Diffstat (limited to 'spec/lib/autotest/puppet_rspec.rb')
-rw-r--r-- | spec/lib/autotest/puppet_rspec.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/lib/autotest/puppet_rspec.rb b/spec/lib/autotest/puppet_rspec.rb new file mode 100644 index 000000000..8536f3912 --- /dev/null +++ b/spec/lib/autotest/puppet_rspec.rb @@ -0,0 +1,46 @@ +require 'autotest' +require 'autotest/rspec' + +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 |