Skip to content

Commit

Permalink
Set up Guard to run RSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
reidab committed Dec 2, 2013
1 parent ecb4fb4 commit 217383f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ group :test do
gem 'cucumber-rails', :require => false
gem 'launchy'
gem 'capybara'
gem 'guard-rspec', require: false

gem 'simplecov', :require => false
gem 'cadre', :require => false
Expand Down
27 changes: 27 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
celluloid (0.15.2)
timers (~> 1.1.0)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.3)
Expand Down Expand Up @@ -118,9 +120,20 @@ GEM
railties (>= 3.0.0)
faraday (0.8.8)
multipart-post (~> 1.2.0)
ffi (1.9.3)
formatador (0.2.4)
gchartrb (0.8)
gherkin (2.12.2)
multi_json (~> 1.3)
guard (2.2.4)
formatador (>= 0.2.4)
listen (~> 2.1)
lumberjack (~> 1.0)
pry (>= 0.9.12)
thor (>= 0.18.1)
guard-rspec (4.0.4)
guard (>= 2.1.1)
rspec (~> 2.14)
hashery (2.1.1)
hashie (2.0.5)
highline (1.6.20)
Expand All @@ -130,6 +143,11 @@ GEM
json (1.8.1)
launchy (2.4.2)
addressable (~> 2.3)
listen (2.2.0)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.4)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
Expand Down Expand Up @@ -206,11 +224,18 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rinku (1.7.3)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
Expand Down Expand Up @@ -240,6 +265,7 @@ GEM
tins (~> 0.8)
thor (0.18.1)
tilt (1.4.1)
timers (1.1.0)
tins (0.13.1)
treetop (1.4.15)
polyglot
Expand Down Expand Up @@ -273,6 +299,7 @@ DEPENDENCIES
exception_notification
factory_girl_rails
gchartrb (~> 0.8.0)
guard-rspec
hashery
launchy
memcache-client
Expand Down
24 changes: 24 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard :rspec do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }

# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }

# Capybara features specs
watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }

# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end

0 comments on commit 217383f

Please sign in to comment.