summaryrefslogtreecommitdiffstats
path: root/spec/lib/autotest/puppet_rspec.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-08 19:48:21 -0600
committerLuke Kanies <luke@madstop.com>2007-11-08 19:48:21 -0600
commit59cc25d798f20bc01943ca341c04716cb037064a (patch)
tree8697db62d970cdff7736a6acb17e97872d42d536 /spec/lib/autotest/puppet_rspec.rb
parent3f583dc133ce50ae34bfc151474c6d4196f803ca (diff)
parent956daa5b4b1c61db9a5e1d7638ca819005fd7ef0 (diff)
downloadpuppet-59cc25d798f20bc01943ca341c04716cb037064a.tar.gz
puppet-59cc25d798f20bc01943ca341c04716cb037064a.tar.xz
puppet-59cc25d798f20bc01943ca341c04716cb037064a.zip
Merge branch 'routing' into test_routing
Diffstat (limited to 'spec/lib/autotest/puppet_rspec.rb')
-rw-r--r--spec/lib/autotest/puppet_rspec.rb46
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