diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-02-13 20:29:00 +1100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-02-13 20:29:00 +1100 |
commit | d3959c497f4c61995f664d88aa3386b54c4baf8d (patch) | |
tree | 1a83a85c0c6d626781cad5632db146aeae49d0c9 /autotest/puppet_rspec.rb | |
parent | c3ead0331adba5f60ea7d508775a89de68e26caa (diff) | |
parent | bcb9b564281003e22d72752d84fa9dc9c8c7107b (diff) | |
download | puppet-d3959c497f4c61995f664d88aa3386b54c4baf8d.tar.gz puppet-d3959c497f4c61995f664d88aa3386b54c4baf8d.tar.xz puppet-d3959c497f4c61995f664d88aa3386b54c4baf8d.zip |
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'autotest/puppet_rspec.rb')
-rw-r--r-- | autotest/puppet_rspec.rb | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/autotest/puppet_rspec.rb b/autotest/puppet_rspec.rb new file mode 100644 index 000000000..fc537e016 --- /dev/null +++ b/autotest/puppet_rspec.rb @@ -0,0 +1,61 @@ +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 + + # Autotest will look for spec commands in the following + # locations, in this order: + # + # * bin/spec + # * default spec bin/loader installed in Rubygems + # * our local vendor/gems/rspec/bin/spec + def spec_commands + [ + File.join('bin', 'spec'), + File.join(Config::CONFIG['bindir'], 'spec'), + File.join('vendor', 'gems', 'rspec', 'bin', 'spec') + ] + end + +end |