2
require 'autotest/rspec'
4
Autotest.add_hook :initialize do |at|
7
# the libraries under lib/puppet
8
at.add_mapping(%r%^lib/puppet/(.*)\.rb$%) { |filename, m|
9
at.files_matching %r!spec/(unit|integration)/#{m[1]}.rb!
12
# the actual spec files themselves
13
at.add_mapping(%r%^spec/(unit|integration)/.*\.rb$%) { |filename, _|
17
# force a complete re-run for all of these:
20
at.add_mapping(%r!^lib/puppet\.rb$!) { |filename, _|
21
at.files_matching %r!spec/(unit|integration)/.*\.rb!
25
at.add_mapping(%r!^spec/spec_helper\.rb$!) { |filename, _|
26
at.files_matching %r!spec/(unit|integration)/.*\.rb!
29
# the puppet test libraries
30
at.add_mapping(%r!^test/lib/puppettest/.*!) { |filename, _|
31
at.files_matching %r!spec/(unit|integration)/.*\.rb!
34
# the puppet spec libraries
35
at.add_mapping(%r!^spec/lib/spec.*!) { |filename, _|
36
at.files_matching %r!spec/(unit|integration)/.*\.rb!
39
# the monkey patches for rspec
40
at.add_mapping(%r!^spec/lib/monkey_patches/.*!) { |filename, _|
41
at.files_matching %r!spec/(unit|integration)/.*\.rb!
45
class Autotest::PuppetRspec < Autotest::Rspec
46
# Autotest will look for spec commands in the following
47
# locations, in this order:
50
# * default spec bin/loader installed in Rubygems
51
# * our local vendor/gems/rspec/bin/spec
54
File.join('vendor', 'gems', 'rspec', 'bin', 'spec') ,
55
File.join('bin', 'spec'),
56
File.join(Config::CONFIG['bindir'], 'spec')