From 8db431dd024e4eef327478befcfbd57fe4e93de1 Mon Sep 17 00:00:00 2001 From: Helge Rausch Date: Tue, 12 Aug 2014 09:12:41 +0200 Subject: [PATCH] Add spring and guard --- Gemfile | 6 ++++++ Gemfile.lock | 29 +++++++++++++++++++++++++++++ Guardfile | 17 +++++++++++++++++ spec/spec_helper.rb | 2 ++ 4 files changed, 54 insertions(+) create mode 100644 Guardfile diff --git a/Gemfile b/Gemfile index 8f23742..126fb83 100644 --- a/Gemfile +++ b/Gemfile @@ -90,6 +90,12 @@ end group :development, :test do gem 'uuidtools' gem 'rspec-rails' +end + +group :development do + gem 'guard-rspec' + gem 'spring' + gem 'spring-commands-rspec' gem 'capistrano', '~> 2.0' gem 'rvm-capistrano', '1.4.4' end diff --git a/Gemfile.lock b/Gemfile.lock index 5f9f03b..7c15fcc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -144,10 +144,21 @@ GEM factory_girl (~> 4.4.0) railties (>= 3.0.0) fastercsv (1.5.5) + ffi (1.9.3) fitgem (0.8.0) oauth + formatador (0.2.5) formtastic (2.2.1) actionpack (>= 3.0) + guard (2.6.1) + formatador (>= 0.2.4) + listen (~> 2.7) + lumberjack (~> 1.0) + pry (>= 0.9.12) + thor (>= 0.18.1) + guard-rspec (4.3.1) + guard (~> 2.1) + rspec (>= 2.14, < 4.0) has_scope (0.6.0.rc) actionpack (>= 3.2, < 5) activesupport (>= 3.2, < 5) @@ -168,6 +179,11 @@ GEM actionpack (>= 3.0.0) activesupport (>= 3.0.0) libv8 (3.16.14.3) + listen (2.7.9) + celluloid (>= 0.15.2) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + lumberjack (1.0.9) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -245,6 +261,9 @@ GEM rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rake (10.3.2) + rb-fsevent (0.9.4) + rb-inotify (0.9.5) + ffi (>= 0.5.0) rdoc (3.12.2) json (~> 1.4) recaptcha (0.3.5) @@ -258,6 +277,10 @@ GEM mime-types (>= 1.16) rsolr (1.0.10) builder (>= 2.1.2) + rspec (3.0.0) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) rspec-core (3.0.0) rspec-support (~> 3.0.0) rspec-expectations (3.0.0) @@ -305,6 +328,9 @@ GEM temple (~> 0.6.3) tilt (~> 1.3, >= 1.3.3) slop (3.5.0) + spring (1.1.3) + spring-commands-rspec (1.0.2) + spring (>= 0.9.1) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) @@ -373,6 +399,7 @@ DEPENDENCIES factory_girl_rails fitgem friendly_id! + guard-rspec i18n (>= 0.6.6) jquery-rails jquery-ui-rails @@ -402,6 +429,8 @@ DEPENDENCIES simplecov sinatra slim (~> 1.3.8) + spring + spring-commands-rspec sunspot_rails sunspot_solr sunspot_test! diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..d8b2e42 --- /dev/null +++ b/Guardfile @@ -0,0 +1,17 @@ +# A sample Guardfile +# More info at https://github.com/guard/guard#readme + +guard :rspec, cmd: "spring rspec", mode: :focus do + watch(%r{^spec/.+_spec\.rb$}) + watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } + watch('spec/spec_helper.rb') { "spec" } + + # Rails + 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" } +end + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fabbb35..66c900f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,4 +42,6 @@ RSpec.configure do |config| # the seed, which is printed after each run. # --seed 1234 config.order = "random" + + config.infer_spec_type_from_file_location! end