Skip to content

Commit 2e2fe85

Browse files
committed
Add automation for rspec tests.
1 parent f2bf227 commit 2e2fe85

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
source "http://rubygems.org"
22

33
gemspec
4+
5+
group :development, :test do
6+
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
7+
gem 'growl', :require => false if RUBY_PLATFORM =~ /darwin/i
8+
gem 'growl_notify', :require => false if RUBY_PLATFORM =~ /darwin/i
9+
end

Guardfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# A sample Guardfile
2+
# More info at https://github.com/guard/guard#readme
3+
4+
guard 'rspec', :version => 2 do
5+
watch(%r{^spec/.+_spec\.rb$})
6+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7+
watch('spec/spec_helper.rb') { "spec" }
8+
9+
# Rails example
10+
watch(%r{^spec/.+_spec\.rb$})
11+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
12+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
13+
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"] }
14+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
15+
watch('spec/spec_helper.rb') { "spec" }
16+
watch('config/routes.rb') { "spec/routing" }
17+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
18+
# Capybara request specs
19+
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
20+
end
21+

github_api.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ Gem::Specification.new do |gem|
2626
gem.add_development_dependency 'jeweler', '~> 1.6.4'
2727
gem.add_development_dependency 'webmock', '~> 1.7.6'
2828
gem.add_development_dependency 'simplecov', '~> 0.4'
29+
gem.add_development_dependency 'guard-rspec'
2930
end

0 commit comments

Comments
 (0)