Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added cucumber 0.1.13 support. Thanks to Ng Tze Yang (ngty).

  • Loading branch information...
commit c025e98b2825d3336ff506555dc11e9e722c7ac9 1 parent 7d49545
@david authored
View
23 README.textile
@@ -2,11 +2,26 @@ h1. merb_cucumber
Merb + Cucumber integration with Webrat support.
+h2. Migrating to merb_cucumber 0.5.0
+
+merb_cucumber 0.5.0 now requires cucumber 0.1.13, which introduces some breaking changes. If you were already using
+merb_cucumber, you'll need to do the following:
+
+* Change the last line of bin/cucumber to be:
+
+ Cucumber::CLI.execute []
+
+* Add a cucumber.yml to your Merb.root with the following contents:
+
+ default: --format pretty features
+
+If you experience any problems, please contact me (david) on github.
+
h2. Requirements
-* merb-core >= 1.0
-* cucumber >= 0.1.9
-* webrat >= 0.3.1 (Optional)
+* merb-core >= 1.0.6.1
+* cucumber >= 0.1.13
+* webrat >= 0.3.2 (Optional)
h2. First Time
@@ -30,4 +45,4 @@ h2. Notes
* When you are implementing the steps of an scenario, please use the new request test helper, if you try to use the
dispatch_to method, it won't work as expected.
-* Webrat methods other than 'visits' are now singular only.
+* Webrat methods other than 'visits' are now singular only.
View
6 Rakefile
@@ -5,7 +5,7 @@ require 'merb-core'
require 'merb-core/tasks/merb'
GEM_NAME = "merb_cucumber"
-GEM_VERSION = "0.4.1"
+GEM_VERSION = "0.5.0"
AUTHOR = ["Roman Gonzalez", "David Leal"]
EMAIL = ["romanandreg@gmail.com", "dgleal@gmail.com"]
HOMEPAGE = "http://github.com/david/merb_cucumber"
@@ -23,8 +23,8 @@ spec = Gem::Specification.new do |s|
s.authors = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
- s.add_dependency('merb-core', '~> 1.0')
- s.add_dependency('cucumber', '>= 0.1.9')
+ s.add_dependency('merb-core', '~> 1.0.6.1')
+ s.add_dependency('cucumber', '>= 0.1.13')
s.require_path = 'lib'
s.files = %w(LICENSE README.textile Rakefile TODO Generators) + Dir.glob("{lib,spec}/**/*")
end
View
1  lib/generators/cucumber.rb
@@ -27,6 +27,7 @@ def self.source_root
end
template(:cucumber, :after => :chmod) { |t| t.source = t.destination = "bin/cucumber" }
+ template(:cucumber_yml) { |t| t.source = t.destination = "cucumber.yml" }
def chmod(action)
File.chmod(0755, action.destination)
View
2  lib/generators/cucumber/templates/bin/cucumber
@@ -12,4 +12,4 @@ if File.directory?(gems_dir = File.join(Dir.pwd, 'gems')) ||
end
require 'cucumber/cli'
-Cucumber::CLI.execute
+Cucumber::CLI.execute []
View
1  lib/generators/cucumber/templates/cucumber.yml
@@ -0,0 +1 @@
+default: -r features/steps -r features/support --format pretty features
View
14 lib/generators/cucumber/templates/features/authentication/login.feature
@@ -2,12 +2,18 @@ Feature: Login
To ensure the safety of the application
A regular user of the system
Must authenticate before using the app
-
- Scenario: Failed Login
+
+ Scenario Outline: Failed Login
Given I am not authenticated
When I go to /login
- And I fill in "login" with "i_dont_exist"
- And I fill in "password" with "and_i_dont_have_a_password"
+ And I fill in "login" with "<mail>"
+ And I fill in "password" with "<password>"
And I press "Log In"
Then the login request should fail
Then I should see an error message
+
+ Examples:
+ | mail | password |
+ | not_an_address | nil |
+ | not@not | 123455 |
+ | 123@abc.com | wrong_paasword |
View
4 lib/generators/cucumber/templates/features/support/env.rb
@@ -19,5 +19,9 @@
# Uncomment if you want transactional fixtures
# Merb::Test::World::Base.use_transactional_fixtures
+# Quick fix for post features running Rspec error, see
+# http://gist.github.com/37930
+def Spec.run? ; true; end
+
Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test')
View
1  lib/generators/cucumber/templates/lib/tasks/cucumber.rake
@@ -2,7 +2,6 @@ require 'cucumber/rake/task'
cucumber_options = proc do |t|
t.binary = Merb.root / 'bin' / 'cucumber'
- t.cucumber_opts = "--format pretty"
end
Cucumber::Rake::Task.new(:features, &cucumber_options)
View
18 merb_cucumber.gemspec
@@ -2,15 +2,15 @@
Gem::Specification.new do |s|
s.name = %q{merb_cucumber}
- s.version = "0.4.1"
+ s.version = "0.5.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Roman Gonzalez", "David Leal"]
- s.date = %q{2008-12-17}
+ s.date = %q{2008-12-21}
s.description = %q{Cucumber integration for Merb}
s.email = ["romanandreg@gmail.com", "dgleal@gmail.com"]
s.extra_rdoc_files = ["README.textile", "LICENSE", "TODO"]
- s.files = ["LICENSE", "README.textile", "Rakefile", "TODO", "Generators", "lib/merb_cucumber.rb", "lib/generators", "lib/generators/cucumber", "lib/generators/cucumber/templates", "lib/generators/cucumber/templates/features", "lib/generators/cucumber/templates/features/support", "lib/generators/cucumber/templates/features/support/env.rb", "lib/generators/cucumber/templates/features/steps", "lib/generators/cucumber/templates/features/steps/webrat_steps.rb", "lib/generators/cucumber/templates/features/steps/result_steps.rb", "lib/generators/cucumber/templates/features/steps/login_steps.rb", "lib/generators/cucumber/templates/features/login.feature", "lib/generators/cucumber/templates/autotest", "lib/generators/cucumber/templates/autotest/cucumber_merb_rspec.rb", "lib/generators/cucumber/templates/bin", "lib/generators/cucumber/templates/bin/cucumber", "lib/generators/cucumber/templates/lib", "lib/generators/cucumber/templates/lib/tasks", "lib/generators/cucumber/templates/lib/tasks/cucumber.rake", "lib/generators/feature", "lib/generators/feature/templates", "lib/generators/feature/templates/feature_steps.rb", "lib/generators/feature/templates/feature.rbt", "lib/generators/cucumber.rb", "lib/generators/feature.rb", "lib/merb_cucumber", "lib/merb_cucumber/world", "lib/merb_cucumber/world/base.rb", "lib/merb_cucumber/world/simple.rb", "lib/merb_cucumber/world/webrat.rb", "lib/merb_cucumber/helpers", "lib/merb_cucumber/helpers/activerecord.rb", "lib/merb_cucumber/helpers/datamapper.rb", "spec/spec_helper.rb", "spec/cucumber_setup_generator_spec.rb", "spec/feature_generator_spec.rb"]
+ s.files = ["LICENSE", "README.textile", "Rakefile", "TODO", "Generators", "lib/merb_cucumber.rb", "lib/generators", "lib/generators/cucumber", "lib/generators/cucumber/templates", "lib/generators/cucumber/templates/features", "lib/generators/cucumber/templates/features/support", "lib/generators/cucumber/templates/features/support/env.rb", "lib/generators/cucumber/templates/features/authentication", "lib/generators/cucumber/templates/features/authentication/steps", "lib/generators/cucumber/templates/features/authentication/steps/login_steps.rb", "lib/generators/cucumber/templates/features/authentication/login.feature", "lib/generators/cucumber/templates/features/steps", "lib/generators/cucumber/templates/features/steps/webrat_steps.rb", "lib/generators/cucumber/templates/features/steps/result_steps.rb", "lib/generators/cucumber/templates/autotest", "lib/generators/cucumber/templates/autotest/cucumber_merb_rspec.rb", "lib/generators/cucumber/templates/cucumber.yml", "lib/generators/cucumber/templates/bin", "lib/generators/cucumber/templates/bin/cucumber", "lib/generators/cucumber/templates/lib", "lib/generators/cucumber/templates/lib/tasks", "lib/generators/cucumber/templates/lib/tasks/cucumber.rake", "lib/generators/feature", "lib/generators/feature/templates", "lib/generators/feature/templates/feature_steps.rb", "lib/generators/feature/templates/feature.rbt", "lib/generators/cucumber.rb", "lib/generators/feature.rb", "lib/merb_cucumber", "lib/merb_cucumber/world", "lib/merb_cucumber/world/base.rb", "lib/merb_cucumber/world/simple.rb", "lib/merb_cucumber/world/webrat.rb", "lib/merb_cucumber/helpers", "lib/merb_cucumber/helpers/activerecord.rb", "lib/merb_cucumber/helpers/datamapper.rb", "spec/spec_helper.rb", "spec/cucumber_setup_generator_spec.rb", "spec/feature_generator_spec.rb"]
s.has_rdoc = true
s.homepage = %q{http://github.com/david/merb_cucumber}
s.require_paths = ["lib"]
@@ -23,14 +23,14 @@ Gem::Specification.new do |s|
s.specification_version = 2
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<merb-core>, ["~> 1.0"])
- s.add_runtime_dependency(%q<cucumber>, [">= 0.1.9"])
+ s.add_runtime_dependency(%q<merb-core>, ["~> 1.0.6.1"])
+ s.add_runtime_dependency(%q<cucumber>, [">= 0.1.13"])
else
- s.add_dependency(%q<merb-core>, ["~> 1.0"])
- s.add_dependency(%q<cucumber>, [">= 0.1.9"])
+ s.add_dependency(%q<merb-core>, ["~> 1.0.6.1"])
+ s.add_dependency(%q<cucumber>, [">= 0.1.13"])
end
else
- s.add_dependency(%q<merb-core>, ["~> 1.0"])
- s.add_dependency(%q<cucumber>, [">= 0.1.9"])
+ s.add_dependency(%q<merb-core>, ["~> 1.0.6.1"])
+ s.add_dependency(%q<cucumber>, [">= 0.1.13"])
end
end
View
4 spec/cucumber_setup_generator_spec.rb
@@ -7,6 +7,10 @@
@generator.should create('/tmp/features/support/env.rb')
end
+ it "should generate the cucumber.yml file" do
+ @generator.should create('/tmp/cucumber.yml')
+ end
+
it "should generate the bin/cucumber file" do
@generator.should create('/tmp/bin/cucumber')
end
Please sign in to comment.
Something went wrong with that request. Please try again.