Skip to content

Instantly share code, notes, and snippets.

@joahking
Created February 7, 2009 16:12
Show Gist options
  • Save joahking/59920 to your computer and use it in GitHub Desktop.
Save joahking/59920 to your computer and use it in GitHub Desktop.
# trying out the scenario outlines cucumber feature
$ gem list cucumber; gem list webrat
*** LOCAL GEMS ***
cucumber (0.1.16)
webrat (0.4.1)
# the feature we are trying features/manage_cukes.feature
Feature: Manage cukes
In order to use scenario outlines
everything should work
Scenario Outline: Testing scenario outlines
Given there are <cuke_versions>
Examples:
|cuke_versions |
|cuke_version 1|
|cuke_version 2|
|cuke_version 3|
|cuke_version 4|
# and step features/step_definitions/cuke_steps.rb
Given /^there are <cuke_versions>$/ do
cuke_version.should_not be_nil
end
Q 1. Is the wiki http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines not accurate?
$ cucumber features/manage_cukes.feature
Scenario Outline: Testing scenario outlines # features/manage_cukes.feature:5
Given there are <cuke_versions> # features/manage_cukes.feature:6
|cuke_versions |
|cuke_version 1|
|cuke_version 2|
|cuke_version 3|
|cuke_version 4|
5 scenarios
4 steps pending (4 with no step definition)
A 1: lets solve it changing Example by More Examples in feature
Q 2. Are we receiving the data in step?
$ cucumber features/manage_cukes.feature
Feature: Manage cukes # features/manage_cukes.feature
In order to use scenario outlines
everything should work
Scenario Outline: Testing scenario outlines # features/manage_cukes.feature:5
Given there are <cuke_versions> # features/manage_cukes.feature:6
|cuke_versions |
|
undefined method `cuke_version' for #<ActionController::Integration::Session:0xb7126abc> (NoMethodError)
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `__send__'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `method_missing'
./features/step_definitions/cuke_steps.rb:2:in ` /^there are <cuke_versions>$/'
features/manage_cukes.feature:9:in `/^there are <cuke_versions>$/'
|
undefined method `cuke_version' for #<ActionController::Integration::Session:0xb711cb48> (NoMethodError)
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `__send__'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `method_missing'
./features/step_definitions/cuke_steps.rb:2:in ` /^there are <cuke_versions>$/'
features/manage_cukes.feature:10:in `/^there are <cuke_versions>$/'
|
undefined method `cuke_version' for #<ActionController::Integration::Session:0xb70e4ff4> (NoMethodError)
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `__send__'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `method_missing'
./features/step_definitions/cuke_steps.rb:2:in ` /^there are <cuke_versions>$/'
features/manage_cukes.feature:11:in `/^there are <cuke_versions>$/'
|
undefined method `cuke_version' for #<ActionController::Integration::Session:0xb70bc770> (NoMethodError)
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `__send__'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/integration.rb:498:in `method_missing'
./features/step_definitions/cuke_steps.rb:2:in ` /^there are <cuke_versions>$/'
features/manage_cukes.feature:12:in `/^there are <cuke_versions>$/'
5 scenarios
4 steps failed
A 2? lets upgrade cucumber (webrat is at its lattest version)
$ gem list cucumber
cucumber (0.1.99.21)
$ cucumber features/manage_cukes.feature
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:442:in `load_missing_constant': uninitialized constant Spec::Runner (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:77:in `const_missing'
from /usr/lib/ruby/gems/1.8/gems/webrat-0.4.1/lib/webrat/rspec-rails.rb:8
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
from /usr/lib/ruby/gems/1.8/gems/polyglot-0.2.4/lib/polyglot.rb:53:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:155:in `require'
from ./features/support/env.rb:16
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
from /usr/lib/ruby/gems/1.8/gems/polyglot-0.2.4/lib/polyglot.rb:53:in `require'
from /usr/lib/ruby/gems/1.8/gems/cucumber-0.1.99.21/bin/../lib/cucumber/cli/main.rb:60:in `require_files'
from /usr/lib/ruby/gems/1.8/gems/cucumber-0.1.99.21/bin/../lib/cucumber/cli/main.rb:58:in `each'
from /usr/lib/ruby/gems/1.8/gems/cucumber-0.1.99.21/bin/../lib/cucumber/cli/main.rb:58:in `require_files'
from /usr/lib/ruby/gems/1.8/gems/cucumber-0.1.99.21/bin/../lib/cucumber/cli/main.rb:34:in `execute!'
from /usr/lib/ruby/gems/1.8/gems/cucumber-0.1.99.21/bin/../lib/cucumber/cli/main.rb:20:in `execute'
from /usr/lib/ruby/gems/1.8/gems/cucumber-0.1.99.21/bin/cucumber:6
from /usr/bin/cucumber:19:in `load'
from /usr/bin/cucumber:19
:-( so, it is now webrat the one that fails. What do you think?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment