Permalink
Browse files

version 3.2.0 - works against rails 3.0.0 to 3.2.0

  • Loading branch information...
1 parent 671efa4 commit b85d17630e8404b123c481c7a39a14e8bbd8f3a6 @timcharper timcharper committed Jan 22, 2012
View
@@ -0,0 +1 @@
+tmp
View
@@ -0,0 +1,14 @@
+source :gemcutter
+gemspec
+# rails is required by the gemspec
+
+gem 'cucumber', '~> 1.0.0'
+gem 'rspec', '~> 2.8'
+gem 'rake'
+gem "spork-rails", :path => "./"
+
+if RUBY_VERSION =~ /^1\.9/
+ gem 'ruby-debug19'
+else
+ gem 'ruby-debug'
+end
View
@@ -0,0 +1,136 @@
+PATH
+ remote: .
+ specs:
+ spork-rails (3.1.0)
+ rails (>= 3.0.0, < 3.3.0)
+ spork (>= 1.0rc0)
+
+PATH
+ remote: .
+ specs:
+ spork-rails (3.1.0)
+ rails (>= 3.0.0, < 3.3.0)
+ spork (>= 1.0rc0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.2.0)
+ actionpack (= 3.2.0)
+ mail (~> 2.4.0)
+ actionpack (3.2.0)
+ activemodel (= 3.2.0)
+ activesupport (= 3.2.0)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.0)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.1)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.0)
+ activesupport (= 3.2.0)
+ builder (~> 3.0.0)
+ activerecord (3.2.0)
+ activemodel (= 3.2.0)
+ activesupport (= 3.2.0)
+ arel (~> 3.0.0)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.0)
+ activemodel (= 3.2.0)
+ activesupport (= 3.2.0)
+ activesupport (3.2.0)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ archive-tar-minitar (0.5.2)
+ arel (3.0.0)
+ builder (3.0.0)
+ columnize (0.3.6)
+ cucumber (1.0.6)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ gherkin (~> 2.4.18)
+ json (>= 1.4.6)
+ term-ansicolor (>= 1.0.6)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ gherkin (2.4.21)
+ json (>= 1.4.6)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.0)
+ json (1.6.5)
+ linecache19 (0.5.12)
+ ruby_core_source (>= 0.1.4)
+ mail (2.4.1)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.17.2)
+ multi_json (1.0.4)
+ polyglot (0.3.3)
+ rack (1.4.0)
+ rack-cache (1.1)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.0)
+ actionmailer (= 3.2.0)
+ actionpack (= 3.2.0)
+ activerecord (= 3.2.0)
+ activeresource (= 3.2.0)
+ activesupport (= 3.2.0)
+ bundler (~> 1.0)
+ railties (= 3.2.0)
+ railties (3.2.0)
+ actionpack (= 3.2.0)
+ activesupport (= 3.2.0)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.8.0)
+ ruby-debug-base19 (0.11.25)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby_core_source (>= 0.1.4)
+ ruby-debug19 (0.11.6)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby-debug-base19 (>= 0.11.19)
+ ruby_core_source (0.1.5)
+ archive-tar-minitar (>= 0.5.2)
+ spork (1.0.0rc0)
+ sprockets (2.1.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ term-ansicolor (1.0.7)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.31)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ cucumber (~> 1.0.0)
+ rake
+ rspec (~> 2.8)
+ ruby-debug19
+ spork-rails!
View
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Tim Harper
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,56 @@
+= Spork Rails
+
+This plugin is for running spork in Ruby-on-Rails applications.
+
+== Version compatibility map:
+
+Versions correspond to the latest Rails minor release. Gem is backwards compatible with rails as far as it makes sense to.
+
+* spork-rails 3.2.0: Rails 3.0.0 - 3.2.x
+
+= Usage:
+
+Add to your Gemfile:
+
+ gem "spork-rails"
+
+ # (Since spork-rails depends on spork, it is not necessary to put both spork and spork-rails in your Gemfile)
+
+== INSTALL:
+
+NOTICE: If using spork with rails, use the spork-rails gem.
+
+=== bundler:
+
+Add to your Gemfile:
+
+ gem 'spork-rails'
+
+== Usage
+
+From a terminal, change to your project directory.
+
+Then, bootstrap your test helper file. If running rspec,
+
+ spork rspec --bootstrap
+
+Cucumber:
+
+ spork cucumber --bootstrap
+
+TestUnit:
+
+ (Install the spork-testunit gem)
+ spork test_unit --bootstrap
+
+(If you don't specifiy a test framework, spork will find one and pick it.)
+
+Follow the instructions.
+
+Finally, run spork. A spec DRb server will be running!
+
+ spork
+
+== See also
+
+See https://github.com/sporkrb/spork for more instructions.
@@ -0,0 +1,107 @@
+Feature: Cucumber integration with rails
+ As a developer using cucumber and rails
+ I want to use Spork with Cucumber
+ In order to eliminate the startup cost of my application each time I run them
+
+ Background: Sporked env.rb
+ Given I am in a fresh rails project named "test_rails_project"
+ And the application has a model, observer, route, and application helper
+ And a file named "features/support/env.rb" with:
+ """
+ require 'rubygems'
+ require 'spork'
+ ENV["RAILS_ENV"] ||= "test"
+
+
+ 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.
+
+ # Sets up the Rails environment for Cucumber
+ require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
+
+ require 'cucumber'
+ require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
+ require 'rspec/rails'
+ # require 'cucumber/rails/rspec'
+
+ #### this is for this test only #######
+ $loaded_stuff << 'prefork block' ######
+ #######################################
+ end
+
+ Spork.each_run do
+ #### this is for this test only #######
+ $loaded_stuff << 'each_run block' #####
+ #######################################
+ end
+ """
+ And a file named "features/cucumber_rails.feature" with:
+ """
+ Feature: cucumber rails
+ Scenario: did it work?
+ Then it should work
+
+ Scenario: did it work again?
+ Then it should work
+ """
+ And a file named "features/support/cucumber_rails_helper.rb" with:
+ """
+ $loaded_stuff << 'features/support/cucumber_rails_helper.rb'
+ """
+ And a file named "config/database.yml" with:
+ """
+ test:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ timeout: 5000
+ """
+ And a file named "features/step_definitions/cucumber_rails_steps.rb" with:
+ """
+ Then "it should work" do
+ (Rails.respond_to?(:logger) ? Rails.logger : ActionController::Base.logger).info "hey there"
+ $loaded_stuff.should include('ActiveRecord::Base.establish_connection')
+ $loaded_stuff.should include('User')
+ $loaded_stuff.should include('UserObserver')
+ $loaded_stuff.should include('ApplicationHelper')
+ $loaded_stuff.should include('config/routes.rb')
+ $loaded_stuff.should include('features/support/cucumber_rails_helper.rb')
+ $loaded_stuff.should include('each_run block')
+ $loaded_stuff.should include('prefork block')
+ puts "It worked!"
+ end
+
+ Alors /ca marche/ do
+ end
+ """
+ Scenario: Analyzing files were preloaded
+ When I run spork --diagnose
+ Then the output should not contain "user_observer.rb"
+ Then the output should not contain "user.rb"
+ Then the output should not contain "app/controllers/application.rb"
+ Then the output should not contain "app/controllers/application_controller.rb"
+ Then the output should not contain "app/controllers/application_helper.rb"
+ Then the output should not contain "features/step_definitions/cucumber_rails_steps.rb"
+ Then the output should not contain "features/support/cucumber_rails_helper.rb"
+
+ Scenario: Running spork with a rails app and no server
+ When I run cucumber --drb features
+ Then the error output should contain
+ """
+ WARNING: No DRb server is running. Running features locally
+ """
+
+ Scenario: Running spork with a rails app and observers
+ When I fire up a spork instance with "spork cucumber"
+ And I run cucumber --drb features
+ Then the error output should be empty
+ And the output should contain "It worked!"
+ And the file "log/test.log" should include "hey there"
+
+ Scenario: Running spork with a rails app and a non-standard port
+ When I fire up a spork instance with "spork cucumber -p 9000"
+ And I run cucumber --drb --port 9000 features
+ Then the error output should be empty
+ And the output should contain "It worked!"
+ And the file "log/test.log" should include "hey there"
@@ -0,0 +1,15 @@
+source :gemcutter
+gem 'sqlite3', '~> 1.3.4'
+gem 'cucumber', '~> 1.0.6'
+# gem 'cucumber-rails', '~> 1.0.6'
+gem "rspec", "2.8.0"
+gem 'rspec-rails'
+gem 'rails', '~> 3.0.7'
+
+if RUBY_VERSION =~ /^1\.9/
+ gem 'ruby-debug19'
+else
+ gem 'ruby-debug', '>= 0.10.3'
+end
+gem 'spork', "~> 1.0.0rc0"
+gem 'spork-rails', :path => "../../../"
Oops, something went wrong.

0 comments on commit b85d176

Please sign in to comment.