forked from refinery/refinerycms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guardfile
32 lines (31 loc) · 1.79 KB
/
Guardfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
guard 'rspec', :version => 2, :spec_paths => ['authentication/spec', 'core/spec', 'dashboard/spec', 'images/spec', 'pages/spec', 'resources/spec', 'settings/spec'], :cli => "--format Fuubar --color --drb" do
[
'authentication',
'core',
'dashboard',
'images',
'pages',
'resources',
'settings'
].each do |engine|
watch(%r{^#{engine}/spec/.+_spec\.rb$})
watch(%r{^#{engine}/app/(.+)\.rb$}) { |m| "#{engine}/spec/#{m[1]}_spec.rb" }
watch(%r{^#{engine}/lib/(.+)\.rb$}) { |m| "#{engine}/spec/lib/#{m[1]}_spec.rb" }
watch(%r{^#{engine}/app/controllers/(.+)_(controller)\.rb$}) { |m| ["#{engine}/spec/routing/#{m[1]}_routing_spec.rb", "#{engine}/spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "#{engine}/spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^#{engine}/spec/support/(.+)\.rb$}) { "#{engine}/spec" }
watch("#{engine}/spec/spec_helper.rb") { "#{engine}/spec" }
watch("#{engine}/config/routes.rb") { "#{engine}/spec/routing" }
watch("#{engine}/app/controllers/application_controller.rb") { "#{engine}/spec/controllers" }
# Capybara request specs
# TODO: Requests specs do not follow a convention that matches view locations so this "suggested" watch and match
# doesn't function. Should we refactor the request_specs or babysit this file?
# watch(%r{^#{engine}/app/views/(.+)/.*\.(erb|haml)$}) { |m| "#{engine}/spec/requests/#{m[1]}_spec.rb" }
end
end
guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('spec/spec_helper.rb')
end