Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

replace guard with zeus

  • Loading branch information...
commit b696ce2896cd0b57fbfaad49644581ca17232d53 1 parent 1d320d2
@ck3g authored
View
7 Gemfile
@@ -31,22 +31,19 @@ group :development do
gem 'capistrano_colors', require: false
gem "erb2haml"
gem "rails_best_practices"
- gem "pry-rails"
gem "thin"
+ gem "zeus"
end
group :development, :test do
gem 'rspec-rails', '~> 2.11.0'
gem 'factory_girl_rails', '~> 3.5.0'
- gem 'guard-rspec', '~> 1.2.0'
+ gem "pry-rails"
end
group :test do
gem "faker", "~> 1.0.1"
gem "launchy"
- gem 'spork', '>= 0.9.0.rc9'
- gem 'guard-spork', '~> 1.1.0'
- gem 'guard-bundler', '~> 1.0.0'
gem "capybara", "~> 1.1.2"
gem "database_cleaner"
gem "shoulda"
View
23 Gemfile.lock
@@ -105,19 +105,6 @@ GEM
faraday (>= 0.7.4, < 0.9)
ffi (1.1.5)
growl (1.0.3)
- guard (1.5.4)
- listen (>= 0.4.2)
- lumberjack (>= 1.0.2)
- pry (>= 0.9.10)
- thor (>= 0.14.6)
- guard-bundler (1.0.0)
- bundler (~> 1.0)
- guard (~> 1.1)
- guard-rspec (1.2.1)
- guard (>= 1.1)
- guard-spork (1.1.0)
- guard (>= 1.1)
- spork (>= 0.8.4)
haml (3.1.7)
has_scope (0.5.1)
hashie (1.2.0)
@@ -140,8 +127,6 @@ GEM
libv8 (3.3.10.4)
libwebsocket (0.1.6)
websocket
- listen (0.5.3)
- lumberjack (1.0.2)
mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -250,7 +235,6 @@ GEM
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.3.3)
- spork (1.0.0rc3)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -290,6 +274,8 @@ GEM
websocket (1.0.1)
xpath (0.1.4)
nokogiri (~> 1.3)
+ zeus (0.13.3)
+ method_source (>= 0.6.7)
PLATFORMS
ruby
@@ -310,9 +296,6 @@ DEPENDENCIES
factory_girl_rails (~> 3.5.0)
faker (~> 1.0.1)
growl (~> 1.0.3)
- guard-bundler (~> 1.0.0)
- guard-rspec (~> 1.2.0)
- guard-spork (~> 1.1.0)
haml (~> 3.1.7)
has_scope (~> 0.5.1)
jquery-rails
@@ -334,7 +317,7 @@ DEPENDENCIES
shoulda
simple_form (~> 2.0.4)
simplecov
- spork (>= 0.9.0.rc9)
therubyracer
thin
uglifier (>= 1.0.3)
+ zeus
View
36 Guardfile
@@ -1,36 +0,0 @@
-# A sample Guardfile
-# More info at https://github.com/guard/guard#readme
-
-guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :cucumber => false do
- watch('config/application.rb')
- watch('config/environment.rb')
- watch('config/environments/test.rb')
- watch(%r{^config/initializers/.+\.rb$})
- watch('Gemfile')
- watch('Gemfile.lock')
- watch('spec/spec_helper.rb') { :rspec }
- watch('test/test_helper.rb') { :test_unit }
- watch(%r{^spec/support/.+\.rb$})
-end
-
-guard 'rspec', :version => 2, :cli => '--color -fd --drb', :all_on_start => false, :all_after_pass => false 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)$}) { |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 request specs
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{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
-
View
11 custom_plan.rb
@@ -0,0 +1,11 @@
+require 'zeus/rails'
+
+class CustomPlan < Zeus::Rails
+
+ # def my_custom_command
+ # # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
+ # end
+
+end
+
+Zeus.plan = CustomPlan.new
View
206 features/step_definitions/email_steps.rb
@@ -1,206 +0,0 @@
-# Commonly used email steps
-#
-# To add your own steps make a custom_email_steps.rb
-# The provided methods are:
-#
-# last_email_address
-# reset_mailer
-# open_last_email
-# visit_in_email
-# unread_emails_for
-# mailbox_for
-# current_email
-# open_email
-# read_emails_for
-# find_email
-#
-# General form for email scenarios are:
-# - clear the email queue (done automatically by email_spec)
-# - execute steps that sends an email
-# - check the user received an/no/[0-9] emails
-# - open the email
-# - inspect the email contents
-# - interact with the email (e.g. click links)
-#
-# The Cucumber steps below are setup in this order.
-
-module EmailHelpers
- def current_email_address
- # Replace with your a way to find your current email. e.g @current_user.email
- # last_email_address will return the last email address used by email spec to find an email.
- # Note that last_email_address will be reset after each Scenario.
- last_email_address || "example@example.com"
- end
-end
-
-World(EmailHelpers)
-
-#
-# Reset the e-mail queue within a scenario.
-# This is done automatically before each scenario.
-#
-
-Given /^(?:a clear email queue|no emails have been sent)$/ do
- reset_mailer
-end
-
-#
-# Check how many emails have been sent/received
-#
-
-Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails?$/ do |address, amount|
- unread_emails_for(address).size.should == parse_email_count(amount)
-end
-
-Then /^(?:I|they|"([^"]*?)") should have (an|no|\d+) emails?$/ do |address, amount|
- mailbox_for(address).size.should == parse_email_count(amount)
-end
-
-Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails? with subject "([^"]*?)"$/ do |address, amount, subject|
- unread_emails_for(address).select { |m| m.subject =~ Regexp.new(Regexp.escape(subject)) }.size.should == parse_email_count(amount)
-end
-
-Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails? with subject \/([^"]*?)\/$/ do |address, amount, subject|
- unread_emails_for(address).select { |m| m.subject =~ Regexp.new(subject) }.size.should == parse_email_count(amount)
-end
-
-Then /^(?:I|they|"([^"]*?)") should receive an email with the following body:$/ do |address, expected_body|
- open_email(address, :with_text => expected_body)
-end
-
-#
-# Accessing emails
-#
-
-# Opens the most recently received email
-When /^(?:I|they|"([^"]*?)") opens? the email$/ do |address|
- open_email(address)
-end
-
-When /^(?:I|they|"([^"]*?)") opens? the email with subject "([^"]*?)"$/ do |address, subject|
- open_email(address, :with_subject => subject)
-end
-
-When /^(?:I|they|"([^"]*?)") opens? the email with subject \/([^"]*?)\/$/ do |address, subject|
- open_email(address, :with_subject => Regexp.new(subject))
-end
-
-When /^(?:I|they|"([^"]*?)") opens? the email with text "([^"]*?)"$/ do |address, text|
- open_email(address, :with_text => text)
-end
-
-When /^(?:I|they|"([^"]*?)") opens? the email with text \/([^"]*?)\/$/ do |address, text|
- open_email(address, :with_text => Regexp.new(text))
-end
-
-#
-# Inspect the Email Contents
-#
-
-Then /^(?:I|they) should see "([^"]*?)" in the email subject$/ do |text|
- current_email.should have_subject(text)
-end
-
-Then /^(?:I|they) should see \/([^"]*?)\/ in the email subject$/ do |text|
- current_email.should have_subject(Regexp.new(text))
-end
-
-Then /^(?:I|they) should see "([^"]*?)" in the email body$/ do |text|
- current_email.default_part_body.to_s.should include(text)
-end
-
-Then /^(?:I|they) should see \/([^"]*?)\/ in the email body$/ do |text|
- current_email.default_part_body.to_s.should =~ Regexp.new(text)
-end
-
-Then /^(?:I|they) should see the email delivered from "([^"]*?)"$/ do |text|
- current_email.should be_delivered_from(text)
-end
-
-Then /^(?:I|they) should see "([^\"]*)" in the email "([^"]*?)" header$/ do |text, name|
- current_email.should have_header(name, text)
-end
-
-Then /^(?:I|they) should see \/([^\"]*)\/ in the email "([^"]*?)" header$/ do |text, name|
- current_email.should have_header(name, Regexp.new(text))
-end
-
-Then /^I should see it is a multi\-part email$/ do
- current_email.should be_multipart
-end
-
-Then /^(?:I|they) should see "([^"]*?)" in the email html part body$/ do |text|
- current_email.html_part.body.to_s.should include(text)
-end
-
-Then /^(?:I|they) should see "([^"]*?)" in the email text part body$/ do |text|
- current_email.text_part.body.to_s.should include(text)
-end
-
-#
-# Inspect the Email Attachments
-#
-
-Then /^(?:I|they) should see (an|no|\d+) attachments? with the email$/ do |amount|
- current_email_attachments.size.should == parse_email_count(amount)
-end
-
-Then /^there should be (an|no|\d+) attachments? named "([^"]*?)"$/ do |amount, filename|
- current_email_attachments.select { |a| a.filename == filename }.size.should == parse_email_count(amount)
-end
-
-Then /^attachment (\d+) should be named "([^"]*?)"$/ do |index, filename|
- current_email_attachments[(index.to_i - 1)].filename.should == filename
-end
-
-Then /^there should be (an|no|\d+) attachments? of type "([^"]*?)"$/ do |amount, content_type|
- current_email_attachments.select { |a| a.content_type.include?(content_type) }.size.should == parse_email_count(amount)
-end
-
-Then /^attachment (\d+) should be of type "([^"]*?)"$/ do |index, content_type|
- current_email_attachments[(index.to_i - 1)].content_type.should include(content_type)
-end
-
-Then /^all attachments should not be blank$/ do
- current_email_attachments.each do |attachment|
- attachment.read.size.should_not == 0
- end
-end
-
-Then /^show me a list of email attachments$/ do
- EmailSpec::EmailViewer::save_and_open_email_attachments_list(current_email)
-end
-
-#
-# Interact with Email Contents
-#
-
-When /^(?:I|they) follow "([^"]*?)" in the email$/ do |link|
- visit_in_email(link)
-end
-
-When /^(?:I|they) click the first link in the email$/ do
- click_first_link_in_email
-end
-
-#
-# Debugging
-# These only work with Rails and OSx ATM since EmailViewer uses RAILS_ROOT and OSx's 'open' command.
-# Patches accepted. ;)
-#
-
-Then /^save and open current email$/ do
- EmailSpec::EmailViewer::save_and_open_email(current_email)
-end
-
-Then /^save and open all text emails$/ do
- EmailSpec::EmailViewer::save_and_open_all_text_emails
-end
-
-Then /^save and open all html emails$/ do
- EmailSpec::EmailViewer::save_and_open_all_html_emails
-end
-
-Then /^save and open all raw emails$/ do
- EmailSpec::EmailViewer::save_and_open_all_raw_emails
-end
View
50 features/support/env.rb
@@ -1,50 +0,0 @@
-# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
-# It is recommended to regenerate this file in the future when you upgrade to a
-# newer version of cucumber-rails. Consider adding your own code to a new file
-# instead of editing this one. Cucumber will automatically load all features/**/*.rb
-# files.
-
-require 'cucumber/rails'
-
-# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
-# order to ease the transition to Capybara we set the default here. If you'd
-# prefer to use XPath just remove this line and adjust any selectors in your
-# steps to use the XPath syntax.
-Capybara.default_selector = :css
-
-# By default, any exception happening in your Rails application will bubble up
-# to Cucumber so that your scenario will fail. This is a different from how
-# your application behaves in the production environment, where an error page will
-# be rendered instead.
-#
-# Sometimes we want to override this default behaviour and allow Rails to rescue
-# exceptions and display an error page (just like when the app is running in production).
-# Typical scenarios where you want to do this is when you test your error pages.
-# There are two ways to allow Rails to rescue exceptions:
-#
-# 1) Tag your scenario (or feature) with @allow-rescue
-#
-# 2) Set the value below to true. Beware that doing this globally is not
-# recommended as it will mask a lot of errors for you!
-#
-ActionController::Base.allow_rescue = false
-
-# Remove/comment out the lines below if your app doesn't have a database.
-# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
-begin
- DatabaseCleaner.strategy = :transaction
-rescue NameError
- raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
-end
-
-# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
-# See the DatabaseCleaner documentation for details. Example:
-#
-# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
-# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
-# end
-#
-# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
-# DatabaseCleaner.strategy = :transaction
-# end
-#
View
126 spec/spec_helper.rb
@@ -2,110 +2,52 @@
SimpleCov.start
require 'rubygems'
-require 'spork'
#uncomment the following line to use spork with the debugger
-#require 'spork/ext/ruby-debug'
-Spork.prefork do
- # Loading more in this block will cause your tests to run faster. However,
- # if you change any configuration or code from libraries loaded here, you'll
- # need to restart spork for it take effect.
+ENV["RAILS_ENV"] = 'test'
+require File.expand_path("../../config/environment", __FILE__)
+require 'rspec/rails'
+require 'capybara/rspec'
- # This file is copied to spec/ when you run 'rails generate rspec:install'
- ENV["RAILS_ENV"] ||= 'test'
- require File.expand_path("../../config/environment", __FILE__)
- require 'rspec/rails'
- require 'capybara/rspec'
+# Requires supporting ruby files with custom matchers and macros, etc,
+# in spec/support/ and its subdirectories.
+Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+Dir[Rails.root.join("spec/shared_behaviors/**/*.rb")].each {|f| require f}
- # Requires supporting ruby files with custom matchers and macros, etc,
- # in spec/support/ and its subdirectories.
- Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
- Dir[Rails.root.join("spec/shared_behaviors/**/*.rb")].each {|f| require f}
+I18n.locale = :en
- I18n.locale = :en
+RSpec.configure do |config|
+ config.mock_with :rspec
- RSpec.configure do |config|
- # == Mock Framework
- #
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
- #
- # config.mock_with :mocha
- # config.mock_with :flexmock
- # config.mock_with :rr
- config.mock_with :rspec
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ config.use_transactional_fixtures = true
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
- # examples within a transaction, remove the following line or assign false
- # instead of true.
- config.use_transactional_fixtures = true
+ config.include Devise::TestHelpers, type: :controller
+ config.extend LoginMacros, type: :controller
- config.include Devise::TestHelpers, type: :controller
- config.extend LoginMacros, type: :controller
+ config.include RequestMacros, type: :request
- config.include RequestMacros, type: :request
-
- # Include Factory Girl syntax to simplify calls to factories
- config.include FactoryGirl::Syntax::Methods
- config.include RequestLoginMacros
- config.include EmailSpec::Helpers
- config.include EmailSpec::Matchers
-
- config.treat_symbols_as_metadata_keys_with_true_values = true
- config.filter_run focus: true
- config.run_all_when_everything_filtered = true
-
- #config.before(:suite) do
- # DatabaseCleaner.strategy = :truncation
- #end
- #
- #config.before(:each) do
- # DatabaseCleaner.start
- #end
- #
- #config.after(:each) do
- # DatabaseCleaner.clean
- #end
-
-end
-
-Spork.each_run do
- # This code will be run each time you run your specs.
- FactoryGirl.reload
-end
-
-# --- Instructions ---
-# Sort the contents of this file into a Spork.prefork and a Spork.each_run
-# block.
-#
-# The Spork.prefork block is run only once when the spork server is started.
-# You typically want to place most of your (slow) initializer code in here, in
-# particular, require'ing any 3rd-party gems that you don't normally modify
-# during development.
-#
-# The Spork.each_run block is run each time you run your specs. In case you
-# need to load files that tend to change during development, require them here.
-# With Rails, your application modules are loaded automatically, so sometimes
-# this block can remain empty.
-#
-# Note: You can modify files loaded *from* the Spork.each_run block without
-# restarting the spork server. However, this file itself will not be reloaded,
-# so if you change any of the code inside the each_run block, you still need to
-# restart the server. In general, if you have non-trivial code in this file,
-# it's advisable to move it into a separate file so you can easily edit it
-# without restarting spork. (For example, with RSpec, you could move
-# non-trivial code into a file spec/support/my_helper.rb, making sure that the
-# spec/support/* files are require'd from inside the each_run block.)
-#
-# Any code that is left outside the two blocks will be run during preforking
-# *and* during each_run -- that's probably not what you want.
-#
-# These instructions should self-destruct in 10 seconds. If they don't, feel
-# free to delete them.
+ # Include Factory Girl syntax to simplify calls to factories
+ config.include FactoryGirl::Syntax::Methods
+ config.include RequestLoginMacros
+ config.include EmailSpec::Helpers
+ config.include EmailSpec::Matchers
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.filter_run focus: true
+ config.run_all_when_everything_filtered = true
+ config.before(:each) do
+ GC.disable
+ end
+ config.after(:each) do
+ GC.enable
+ end
end
View
20 zeus.json
@@ -0,0 +1,20 @@
+{
+ "command": "ruby -rubygems -r./custom_plan -eZeus.go",
+
+ "plan": {
+ "boot": {
+ "default_bundle": {
+ "development_environment": {
+ "prerake": {"rake": []},
+ "console": ["c"],
+ "server": ["s"],
+ "generate": ["g"],
+ "destroy": ["d"]
+ },
+ "test_environment": {
+ "test_helper": {"test": ["rspec"]}
+ }
+ }
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.