Skip to content

Commit

Permalink
Merge pull request spree#797 from parndt/master
Browse files Browse the repository at this point in the history
Run tests simply with 'guard'
  • Loading branch information
radar committed Nov 20, 2011
2 parents 178a470 + 4ba8625 commit 9c613d5
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ group :assets do
end

group :test do
gem 'guard'
gem 'guard-rspec', '~> 0.5.0'
gem 'rspec-rails', '~> 2.7.0'
gem 'factory_girl_rails', '~> 1.4.0'
gem 'rcov'
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ GEM
ffi (1.0.11)
gherkin (2.4.21)
json (>= 1.4.6)
guard (0.8.8)
thor (~> 0.14.6)
guard-rspec (0.5.4)
guard (>= 0.8.4)
highline (1.6.2)
hike (1.2.1)
i18n (0.6.0)
Expand Down Expand Up @@ -262,6 +266,8 @@ DEPENDENCIES
database_cleaner (= 0.6.7)
factory_girl_rails (~> 1.4.0)
faker
guard
guard-rspec (~> 0.5.0)
json
launchy
mysql2 (~> 0.3.6)
Expand Down
13 changes: 13 additions & 0 deletions api/Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
guard 'rspec', :version => 2, :spec_paths => %w(spec),
:cli => (File.read('.rspec').split("\n").join(' ') if File.exists?('.rspec')) do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch("spec/spec_helper.rb") { "spec" }
watch("config/routes.rb")
watch("app/controllers/application_controller.rb") { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
13 changes: 13 additions & 0 deletions auth/Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
guard 'rspec', :version => 2, :spec_paths => %w(spec),
:cli => (File.read('.rspec').split("\n").join(' ') if File.exists?('.rspec')) do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch("spec/spec_helper.rb") { "spec" }
watch("config/routes.rb")
watch("app/controllers/application_controller.rb") { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
13 changes: 13 additions & 0 deletions core/Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
guard 'rspec', :version => 2, :spec_paths => %w(spec),
:cli => (File.read('.rspec').split("\n").join(' ') if File.exists?('.rspec')) do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch("spec/spec_helper.rb") { "spec" }
watch("config/routes.rb")
watch("app/controllers/application_controller.rb") { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
13 changes: 13 additions & 0 deletions dash/Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
guard 'rspec', :version => 2, :spec_paths => %w(spec),
:cli => (File.read('.rspec').split("\n").join(' ') if File.exists?('.rspec')) do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch("spec/spec_helper.rb") { "spec" }
watch("config/routes.rb")
watch("app/controllers/application_controller.rb") { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
13 changes: 13 additions & 0 deletions promo/Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
guard 'rspec', :version => 2, :spec_paths => %w(spec),
:cli => (File.read('.rspec').split("\n").join(' ') if File.exists?('.rspec')) do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch("spec/spec_helper.rb") { "spec" }
watch("config/routes.rb")
watch("app/controllers/application_controller.rb") { "spec/controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end

0 comments on commit 9c613d5

Please sign in to comment.