guard mixins properly
This commit is contained in:
22
Guardfile
22
Guardfile
@@ -7,23 +7,25 @@ guard_opts = {
|
|||||||
all_after_pass: true,
|
all_after_pass: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
def all_specs
|
def all_specs; 'spec' end
|
||||||
'spec'
|
def library_specs; 'spec/libraries' end
|
||||||
end
|
def provider_specs; 'spec/providers' end
|
||||||
|
|
||||||
group :rspec do
|
group :rspec do
|
||||||
guard 'rspec', guard_opts do
|
guard 'rspec', guard_opts do
|
||||||
watch(%r{^Gemfile$}) { all_specs }
|
watch(%r{^Gemfile$}) { all_specs }
|
||||||
watch(%r{^Gemfile.lock$}) { all_specs }
|
watch(%r{^Gemfile.lock$}) { all_specs }
|
||||||
watch(%r{^spec/spec_helper\.rb$}) { all_specs }
|
watch(%r{^spec/spec_helper\.rb$}) { all_specs }
|
||||||
watch(%r{^spec/helpers/(.+)\.rb$}) { all_specs }
|
watch(%r{^spec/helpers/(.+)\.rb$}) { all_specs }
|
||||||
watch(%r{^spec/fixtures/(.+)\.rb$}) { all_specs }
|
watch(%r{^spec/fixtures/(.+)\.rb$}) { all_specs }
|
||||||
watch(%r{^libraries/pacemaker\.rb$}) { all_specs }
|
watch(%r{^libraries/pacemaker\.rb$}) { all_specs }
|
||||||
|
watch(%r{^libraries/(.*mixin.*)\.rb$}) { library_specs }
|
||||||
watch(%r{^spec/.+_spec\.rb$})
|
watch(%r{^spec/.+_spec\.rb$})
|
||||||
watch(%r{^libraries/(.+)\.rb$}) { |m|
|
watch(%r{^libraries/(.+)\.rb$}) { |m|
|
||||||
"spec/libraries/#{m[1]}_spec.rb"
|
"spec/libraries/#{m[1]}_spec.rb"
|
||||||
}
|
}
|
||||||
watch(%r{^providers/common\.rb$}) { all_specs }
|
watch(%r{^providers/common\.rb$}) { provider_specs }
|
||||||
|
watch(%r{^providers/(.*mixin.*)\.rb$}) { provider_specs }
|
||||||
watch(%r{^(resources|providers)/(.+)\.rb$}) { |m|
|
watch(%r{^(resources|providers)/(.+)\.rb$}) { |m|
|
||||||
"spec/providers/#{m[1]}_spec.rb"
|
"spec/providers/#{m[1]}_spec.rb"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user