Permalink
Browse files

Setup Spork and Guard to create quicker and automated tests for RSpec…

…. Started using foreman again for easier management with web services and cross platform environment variables.
  • Loading branch information...
1 parent 0f411b3 commit c6452e9b93df9e467f2f74acdcf296363591bcb5 Billy Dallimore committed Feb 27, 2014
View
@@ -1,2 +1,3 @@
+--drb
--color
--format documentation
View
@@ -36,6 +36,9 @@ group :test do
gem 'database_cleaner'
gem 'shoulda-matchers'
gem 'faker'
+ gem 'spork'
+ gem 'guard-rspec', require: false
+ gem 'guard-spork'
# Testing postgresql on Travis CI
gem 'pg'
end
@@ -103,10 +106,6 @@ gem 'sitemap_generator'
gem 'global'
# Processing
-gem 'sidekiq', :require => false
-gem 'sidekiq-failures'
-gem 'slim'
-gem 'sinatra', '>= 1.3.0', :require => nil
gem 'whenever', :require => false
# To use ActiveModel has_secure_password
View
@@ -89,6 +89,11 @@ GEM
json (>= 1.7)
celluloid (0.15.2)
timers (~> 1.1.0)
+ celluloid-io (0.15.0)
+ celluloid (>= 0.15.0)
+ nio4r (>= 0.5.0)
+ childprocess (0.5.1)
+ ffi (~> 1.0, >= 1.0.11)
chronic (0.10.2)
chunky_png (1.2.9)
churn (0.0.35)
@@ -117,7 +122,6 @@ GEM
sass (~> 3.1)
compass-rails (1.1.3)
compass (>= 0.12.2)
- connection_pool (1.2.0)
database_cleaner (1.2.0)
debug_inspector (0.0.2)
devise (3.2.2)
@@ -138,6 +142,8 @@ GEM
faker (1.2.0)
i18n (~> 0.5)
fattr (2.2.1)
+ ffi (1.9.3)
+ ffi (1.9.3-x86-mingw32)
flay (2.4.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
@@ -167,6 +173,19 @@ GEM
fssm (0.2.10)
global (0.0.3)
activesupport
+ guard (2.5.1)
+ formatador (>= 0.2.4)
+ listen (~> 2.6)
+ lumberjack (~> 1.0)
+ pry (>= 0.9.12)
+ thor (>= 0.18.1)
+ guard-rspec (4.2.7)
+ guard (~> 2.1)
+ rspec (>= 2.14, < 4.0)
+ guard-spork (1.5.1)
+ childprocess (>= 0.2.3)
+ guard (>= 1.1)
+ spork (>= 0.8.4)
haml (4.0.5)
tilt
haml-rails (0.4)
@@ -191,10 +210,16 @@ GEM
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.8.1)
+ listen (2.6.1)
+ celluloid (>= 0.15.2)
+ celluloid-io (>= 0.15.0)
+ rb-fsevent (>= 0.9.3)
+ rb-inotify (>= 0.9)
lograge (0.2.2)
actionpack (>= 3)
activesupport (>= 3)
railties (>= 3)
+ lumberjack (1.0.4)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
@@ -240,13 +265,15 @@ GEM
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
newrelic_rpm (3.7.1.188)
+ nio4r (1.0.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
nokogiri (1.6.1-x86-mingw32)
mini_portile (~> 0.5.0)
orm_adapter (0.5.0)
parallel (0.9.2)
pg (0.17.1)
+ pg (0.17.1-x86-mingw32)
polyglot (0.3.3)
pr_geohash (1.0.0)
pry (0.9.12.4)
@@ -270,8 +297,6 @@ GEM
rack-pjax (0.7.0)
nokogiri (~> 1.5)
rack (~> 1.3)
- rack-protection (1.5.2)
- rack
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
@@ -317,16 +342,16 @@ GEM
thor (>= 0.14.6, < 2.0)
raindrops (0.12.0)
rake (10.1.1)
+ rb-fsevent (0.9.4)
+ rb-inotify (0.9.3)
+ ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
redactor-rails (0.4.3)
devise
mime-types
orm_adapter
redcard (1.1.0)
- redis (3.0.7)
- redis-namespace (1.4.1)
- redis (~> 3.0.4)
reek (1.3.6)
ruby2ruby (~> 2.0.7)
ruby_parser (~> 3.2)
@@ -341,6 +366,10 @@ GEM
ruby_parser (~> 3.2, >= 3.2.2)
rsolr (1.0.9)
builder (>= 2.1.2)
+ 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)
@@ -358,6 +387,7 @@ GEM
ruby2ruby (2.0.7)
ruby_parser (~> 3.1)
sexp_processor (~> 4.0)
+ ruby_gntp (0.3.4)
ruby_parser (3.3.0)
sexp_processor (~> 4.1)
safe_yaml (0.9.7)
@@ -369,24 +399,12 @@ GEM
sexp_processor (4.4.1)
shoulda-matchers (2.5.0)
activesupport (>= 3.0.0)
- sidekiq (2.17.3)
- celluloid (>= 0.15.2)
- connection_pool (>= 1.0.0)
- json
- redis (>= 3.0.6)
- redis-namespace (>= 1.3.1)
- sidekiq-failures (0.3.0)
- sidekiq (>= 2.14.0)
- sinatra (1.4.4)
- rack (~> 1.4)
- rack-protection (~> 1.4)
- tilt (~> 1.3, >= 1.3.4)
sitemap_generator (4.3.1)
builder
- slim (2.0.2)
- temple (~> 0.6.6)
- tilt (>= 1.3.3, < 2.1)
slop (3.4.7)
+ spork (1.0.0rc4)
+ spork (1.0.0rc4-x86-mingw32)
+ win32-process
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -403,7 +421,6 @@ GEM
rails (>= 3)
sunspot (= 2.1.0)
sunspot_solr (2.1.0)
- temple (0.6.7)
thor (0.18.1)
thread_safe (0.1.3)
atomic
@@ -432,6 +449,8 @@ GEM
chronic (>= 0.6.3)
wicked (1.0.2)
rails (>= 3.0.7)
+ win32-process (0.7.4)
+ ffi (>= 1.0.0)
win32console (1.3.2-x86-mingw32)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -463,6 +482,8 @@ DEPENDENCIES
foreman (~> 0.61.0)
friendly_id (~> 4.0.10)
global
+ guard-rspec
+ guard-spork
haml
haml-rails
jquery-rails
@@ -481,13 +502,11 @@ DEPENDENCIES
redactor-rails
rollbar
rspec-rails
+ ruby_gntp
sass-rails (~> 3.2.3)
shoulda-matchers
- sidekiq
- sidekiq-failures
- sinatra (>= 1.3.0)
sitemap_generator
- slim
+ spork
sqlite3
sunspot_rails
sunspot_solr
View
@@ -0,0 +1,34 @@
+# 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
+
+
+guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' } do
+ watch('config/application.rb')
+ watch('config/environment.rb')
+ watch('config/environments/test.rb')
+ watch(%r{^config/initializers/.+\.rb$})
+ watch('Gemfile.lock')
+ watch('spec/spec_helper.rb') { :rspec }
+ watch(%r{features/support/}) { :cucumber }
+end
View
@@ -1,2 +1,2 @@
-web: bundle exec rails s -p 9000
-search: sudo rake sunspot:solr:start
+web: bundle exec guard
+
View
@@ -8,17 +8,17 @@ development:
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
- adapter: mysql2 # Rails 3.x uses the mysql2 adapter
- encoding: utf8
- database: gimson_robotics_test_db
- host: localhost
- pool: 30
- username: root
- socket: /tmp/mysql.sock
- # adapter: sqlite3
- # database: db/test.sqlite3
- # pool: 5
- # timeout: 5000
+ # adapter: mysql2 # Rails 3.x uses the mysql2 adapter
+ # encoding: utf8
+ # database: gimson_robotics_test_db
+ # host: localhost
+ # pool: 30
+ # username: root
+ # socket: /tmp/mysql.sock
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
production:
View
@@ -47,7 +47,6 @@
namespace :admin do
root :to => "admin#dashboard"
mount RailsAdmin::Engine => '/db'
- mount Sidekiq::Web => '/jobs'
post '/paypal/ipn' => 'transactions#paypal_ipn'
resources :accessories, :shippings, :products, :categories, :except => :show
resources :orders, :only => [:index, :show, :update]
View
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -6,4 +6,5 @@
it { expect(subject).to belong_to(:accessory) }
it { expect(subject).to belong_to(:product) }
+ # hai
end
Oops, something went wrong.

0 comments on commit c6452e9

Please sign in to comment.