Code Monkey home page Code Monkey logo

cucumber-ruby's Introduction

Cucumber Open - Supported by Smartbear

Cucumber

Stand With Ukraine OpenCollective OpenCollective Test cucumber Code Climate Coverage Status

Cucumber is a tool for running automated tests written in plain language. Because they're written in plain language, they can be read by anyone on your team. Because they can be read by anyone, you can use them to help improve communication, collaboration and trust on your team.

Cucumber Gherkin Example

This is the Ruby implementation of Cucumber. Cucumber is also available for JavaScript, Java, and a lot of other languages. You can find a list of implementations here: https://cucumber.io/docs/installation/.

See CONTRIBUTING.md for info on contributing to Cucumber (issues, PRs, etc.).

Everyone interacting in this codebase and issue tracker is expected to follow the Cucumber code of conduct.

Installation

Cucumber for Ruby is a Ruby gem. Install it as you would install any gem: add cucumber to your Gemfile:

gem 'cucumber'

then install it:

$ bundle

or install the gem directly:

$ gem install cucumber

Later in this document, bundler is considered being used so all commands are using bundle exec. If this is not the case for you, execute cucumber directly, without bundle exec.

Supported platforms

  • Ruby 3.2
  • Ruby 3.1
  • Ruby 3.0
  • Ruby 2.7
  • TruffleRuby 22.0.0+
  • JRuby 9.4+ (with some limitations)

Ruby on Rails

Using Ruby on Rails? You can use cucumber-rails to bring Cucumber into your Rails project.

Usage

Initialization

If you need to, initialize your features directory with

$ bundle exec cucumber --init

This will create the following directories and files if they do not exist already:

features
├── step_definitions
└── support
    └── env.rb

Create your specification

Create a file named rule.feature in the features directory with:

# features/rule.feature

Feature: Rule Sample

  Rule: This is a rule

    Example: A passing example
      Given this will pass
      When I do an action
      Then some results should be there

    Example: A failing example
      Given this will fail
      When I do an action
      Then some results should be there

Automate your specification

And a file named steps.rb in features/step_definitions with:

# features/step_definitions/steps.rb

Given('this will pass') do
  @this_will_pass = true
end

Given('this will fail') do
  @this_will_pass = false
end

When('I do an action') do
  :no_op
end

Then("some results should be there") do
  expect(@this_will_pass).to be true
end

Run Cucumber

$ bundle exec cucumber

To execute a single feature file:

$ bundle exec cucumber features/rule.feature

To execute a single example, indicates the line of the name of the example:

$ bundle exec cucumber features/rule.feature:5

To summarize the results on the standard output, and generate a HTML report on disk:

$ bundle exec cucumber --format summary --format html --out report.html

For more command line options

$ bundle exec cucumber --help

You can also find documentation on the command line possibilities in features/docs/cli.

Documentation and support

Copyright

Copyright (c) Cucumber Ltd. and Contributors. See LICENSE for details.

cucumber-ruby's People

Contributors

aslakhellesoy avatar aurelien-reeves avatar bmabey avatar botandrose-machine avatar brasmusson avatar brynary avatar cbliard avatar danascheider avatar danlucraft avatar dcadenas avatar dchelimsky avatar ghnatiuk avatar jarib avatar jimvm avatar johnvoloski avatar josephwilk avatar luke-hill avatar madsbuus avatar mattwynne avatar msassak avatar mxygem avatar olleolleolle avatar os97673 avatar peeja avatar renovate[bot] avatar tmak avatar tom025 avatar tooky avatar vincent-psarga avatar xtrasimplicity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cucumber-ruby's Issues

Running with autospec and --drb in cucumber.yml, "No DRb server is running."

I was trying to speed up test execution for cucumber tests between code changes. I've been using the following command most of the time when coding recently (Note that I'm using rails):

AUTOFEATURE=true script/autospec

One very important thing to know is that I'm running my specs through Cygwin on Windows, so Spork is out of the question (for now?). In my spec/spec.opts file i have the -X option (alias of --drb) and in a separate cygwin terminal I run "script/spec_server".

This has been working pretty well for me so far (Although I really would love to see some Windows support for spork), it runs all the rspec tests through the drb server and they run immediately when I make the appropriate changes. However, the cucumber tests were still taking awhile to start up each time so I decided to see if there was a way to get it to run through the drb server as well. I learned about the cucumber.yml file you can put in your project root, so I added that with the autotest and autotest-all profiles. Right now it looks like this:

default: --format pretty
autotest-all: --drb --format progress --format rerun
autotest: --drb --format pretty --format rerun

However, when I have spec_server running, and i run the AUTOFEATURE=true script/autospec
command the rspec tests go swiftly as usual (through the drb server), but cucumber reports the following error:

/usr/bin/ruby /usr/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/cucumber --profile autotest --format rerun --out /cygdrive/c/Users/user/AppData/Local/Temp/autotest-cucumber20090721-5900-1uhih6y-0 features/add_category.feature:8:21:33
WARNING: No DRb server is running. Running features locally:

Now you state it was built specifically for spork, but will support any drb server - So I would expect it to work with the 'deprecated' (How can you deprecate something that has no replacement...?) spec_server, any idea what I can do to resolve this? ^.^

Exception when running generator

jwilger Vidar:~/projects/tssi [1013]% ./script/generate cucumber -t                                                                 pdxrails:(master)
      exists  features/step_definitions
overwrite features/step_definitions/webrat_steps.rb? (enter "h" for help) [Ynaqdh] y
       force  features/step_definitions/webrat_steps.rb
      create  config/environments/cucumber.rb
uninitialized constant Rails::Generator::Commands::Create::Cucumber
  /Users/jwilger/projects/tssi/vendor/rails/activesupport/lib/active_support/dependencies.rb:105:in `const_missing_before_generators'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/lookup.rb:15:in `const_missing'
  (erb):18:in `template'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:301:in `template'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:379:in `render_file'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:377:in `open'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:377:in `render_file'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:260:in `file'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:259:in `open'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:259:in `file'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:298:in `template'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/manifest.rb:47:in `send'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/manifest.rb:47:in `send_actions'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in `each'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in `send_actions'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/manifest.rb:31:in `replay'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/commands.rb:42:in `invoke!'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/rails_generator/scripts/../scripts.rb:31:in `run'
  /Users/jwilger/projects/tssi/vendor/rails/railties/lib/commands/generate.rb:6
  /Users/jwilger/projects/tssi/deps/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  /Users/jwilger/projects/tssi/deps/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
  ./script/generate:3
jwilger Vidar:~/projects/tssi [1014]% ruby vendor/rails/railties/bin/rails -v                                                       pdxrails:(master)
Rails 2.3.2

Nested steps in backtraces

In current backtraces only the top level step definition is being shown. When a step invokes another step using the When, Then, or Given methods, the invoking steps are being stripped from the backtrace, when they are the more interesting part of the backtrace on many occasions. All step definitions and line numbers should be present in the backtrace.

cucumber does not repport failure on failure

We have cases where scenarios or steps fail and it is not reported at all to jenkins via junit output.
All junit output have errors=0 and failures=0.

We finaly found a good and easy way to reproduce it - simply delete the step_definitions directory and run rake cucumber:ok.

We often get this on full builds even though we have no undefined steps, so it seems to be a general bug with handling failures, that is really easily triggered in this way.

We can also see from the output directory that cucumber has not saved output files for all the scenarios so it has most likely quit on the first failure. But what really does not make sence is how apperently tests has succeeded and generated junit files with errors=0 and failures=0 without having a step_definitions directory.

bash-3.2$ rake cucumber:ok --trace
(in /u01/jenkins/jobs/CI-WS/workspace/tests/cucumber)
** Invoke cucumber:ok (first_time)
** Execute cucumber:ok
bundle exec /var/lib/jenkins/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -I "/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib:lib" "/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/bin/cucumber"  --profile default
Using the default profile...
rake aborted!
Command failed with status (1): [bundle exec /var/lib/jenkins/.rvm/rubies/r...]
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:995:in `block in sh'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:in `call'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:in `sh'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1094:in `sh'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/rake/task.rb:79:in `run'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/rake/task.rb:149:in `block in define_task'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/var/lib/jenkins/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/bin/rake:25:in `load'
/var/lib/jenkins/.rvm/gems/ruby-1.9.2-p180/bin/rake:25:in `<main>'

Cucumber version 0.10.2 - ruby 1.9.2-p180

cucumber.yml: (CUCUMBER_FORMAT is junit)

<%
paths = "--exclude \/page_objects\/.*.rb$"

rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
#std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip --tags ~@broken"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@broken --tags ~@wip"
jenkins_opts = ""
jenkins_opts = "--out #{ ENV['CUCUMBER_OUTPUT']}" if ENV['CUCUMBER_OUTPUT']
%>
default: <%= std_opts %> features <%= paths %> <%= jenkins_opts %>
wip: --tags @wip:200 --wip features <%= paths %>
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip <%= paths %>
# you will get a cookie if you find out why --dry-run doesnt dry-run
usage: <%= std_opts %> --dry-run --format usage --out usage.txt features <%= paths %>

orderflow: --tags @orderflow --strict <%= paths %>

Around hooks should be run before Background

Original Lighthouse Ticket 633 and 681

For background + scenarios the execution order should be:

around do
  before
  background steps
  scenario 1 steps
  after
end

around do
  before
  background steps
  scenario 2 steps
  after
end

...

For background + scenario outlines the execution order should be:

around do
  before
  background steps
  example 1 steps
  after
end

around do
  before
  background steps
  example 2 steps
  after
end

...

I took a stab at this but it looks hard -- given the current structure of the Ast classes, there's no correct place to put the around block. It needs to wrap both the first execution of the background steps as well as the execution of the steps of the first feature element (either the first scenario or the first example of the first scenario outline).

A related problem is that the World is currently nil (uninitialized) in Around hooks.

@mattwynne writes (from LH ticket 681):

There are two threads from the mailing list about this. It started here:
http://groups.google.com/group/cukes/browse_thread/thread/6dc76556f2bfe854

...which shows that the order in which the hooks fire is unexpected.

then this also cropped up:
http://groups.google.com/group/cukes/browse_thread/thread/045fdb4dcf0ea40c

...which shows that the hooks don't fire in the context of the World.

I've started looking at them in this branch:
https://github.com/mattwynne/cucumber/tree/fix-around-hook

Issue running Polish example

Hi,

I'm getting the following undefined method error when running the Polish language example. By way of comparison, the German example works for me, so is it something to do with encoding? I have checked, and I have version 0.2.5 of the Polyglot gem installed.

C:\calculator_marcin>cucumber features
undefined method Zakładając' for #<Object:0x284f9e8> (NoMethodError) ./features/step_definitions/calculator_steps.rb:15 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_re
quire'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in polyglot_origin al_require' C:/Ruby/lib/ruby/gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:inrequire'
C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/cli/main.rb:9
5:in require_files' C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/cli/main.rb:1 04:ineach_lib'
C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/cli/main.rb:1
02:in each' C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/cli/main.rb:1 02:ineach_lib'
C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/cli/main.rb:9
5:in require_files' C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/cli/main.rb:4 7:inexecute!'
C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/cli/main.rb:2
5:in execute' C:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.3.11/bin/cucumber:9 C:/Ruby/bin/cucumber:19:inload'
C:/Ruby/bin/cucumber:19

Thanks.

Background and skipped scenarios

Given I have feature with a background and two scenarios. Then I mark both scenarios with @approved tag and run "cucumber --tags ~@approved", background still gets executed. That forces me to mark background with the same tag and remove it when I add new scenarios (or to set and remove tag to the feature, there's no difference anyway).
What I expect is skipping background by default if there's no scenarios to execute.

Error in Steps ruby file.

ruby steps of the file that is in the folder steps_definitions Então|Entao Well he can not only identify all the features but as As and when the file ruby it works only with the problem Então. Passing the argument that -l pt

Rerun formatter output does not include failing scenario outline examples

Moved from Lighthouse ticket #701

The output file created by the rerun formatter does not include the failures encountered while running scenario outline examples

If one scenario fails, and two scenario outline examples fail, the output file will only include the scenario failure.

I would expect the output file to include the line number of the entire scenario outline, since line numbers of specific examples are not supported.

Feature file and step definition that reproduces this: https://gist.github.com/834214

Cucumber reports empty Background as error wwhen Scenario: statement absent

Original Lighthouse Ticket 703

I revived this one, as I just ran into it after upgrading from 0.10.2 to 1.0.0. My case is slightly different from the one in the original ticket: my feature looks like this:

Background: background_description
Given ...

@some_tag
Scenario: some_description
When ...

@some_tag
Scenario: some_other description
When ...

I have a profile that excludes 'some_tag' from the run. When I use that, no Scenarios are left in this specific file of features and the originally reported error is raised:

Background: modeler is logged in, has entered a model and sees the model # features/where_clauses.feature:11 
undefined method `tag_names' for nil:NilClass (NoMethodError)
/home/wever/dev/axini/Hare/trunk/vendor/bundle/ruby/1.8/gems/activesupport-3.0.4/lib/active_support/whiny_nil.rb:48:in `method_missing'
/home/wever/dev/axini/Hare/trunk/vendor/bundle/ruby/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/feature_element.rb:70:in `source_tag_names'
/home/wever/dev/axini/Hare/trunk/vendor/bundle/ruby/1.8/gems/capybara-1.0.0/lib/capybara/cucumber.rb:18:in `Before'

This error does not make the build fail. The error is not raised when the build that includes 'some_tag' is built.

Console / Cucumber IRB

Hi folks!

When using cucumber i usually write a bunch of scenario steps and afterwards i run the whole scenario. When the first step fails, i fix it and then i run cucumber again. So for each step (or line) i have to repeat the whole scenario.. This slows my productiviy a lot..

What i'd like to have is something like a IRB shell where i can run a single step over and over again, e.g.

when 'i do something' # entering this should immediately find the matching step and execute it
# => false # step failed
obj.do_some_other_stuff  # then some plain ruby code to make the step pass...   
when 'i do something' # repeat the step..
# => true # step passed

I expect this would speed up the development/fixing of cucumber steps a lot..

What i already saw is an implementation for a very early version of cucumber:
https://github.com/maiha/crb

I wonder what are your thoughts about this - maybe there's already a better approach to using cucumber..

And of course i am interested in how easy it would be to implement sth like that for latest cucumber...

Thanks
--dpree

DRB::UnknownObject in HTML output with Spork

Reopening old but still valid lighthouse ticket:

When running Cucumber with Spork, I get a DRB::UnknownObject instead of the step name (with --format html, not with --format pretty). Added this to env.rb to solve the issue. No idea why h() cannot be found. I saw you included ERB::Util. Even tested if ERB::Util.respond_to?(:html_escape) is true (and it is).

class Cucumber::Formatter::Html
  # For some reason, h() cannot be found when run with Spork
  def h(s)
    s.gsub(/[&"><]/) { |special| HTML_ESCAPE[special] }
  end
end

Rename PyString to DocString

With this rename we can use the same term in Cucumber documentation and Cucumber code. Right now we say "multiline string" in documentation and PyString in the code. That's confusing.

And to make things consistent, We should rename step tables to DocTable!

This change will require changes to gherkin, cucumber code and wikis.

undefined method `fork=' for #<Cucumber::Rake::Task:0x18ffa4c>

I installed the cucumber gem (0.3.6) and ran script/generate cucumber.

Now, rake fails for me with the following error:

rake aborted!
undefined method `fork=' for #Cucumber::Rake::Task:0x18ffa4c
/Users/mark/code/HireExchange/Rakefile:10

Here is my Rakefile:

require(File.join(File.dirname(FILE), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'

Any ideas?

Thanks,
Mark

uninitialized constant Gherkin::Formatter::Model::PyString

can't get basics up and running on Rails 3

Trying to follow the instructions here

https://github.com/cucumber/cucumber/wiki/Ruby-on-Rails

At the very top of these instructions there is a link that says if you on Rails 3 you should go to the README, but the link is broken (goes to 404). Would you please fix that?

I think the right link is https://github.com/cucumber/cucumber-rails/blob/master/README.md

Even when I follow the README instructions for Rails 3, I still get this error. I've googled for this error but found only references to it appear when using other gems. (I am not using other gems -- this is a brand new Rails 3.0.8 app that I just started from scratch).

Please advise. Thanks

/opt/local/bin/ruby -S bundle exec cucumber --profile default
Using the default profile...
uninitialized constant Gherkin::Formatter::Model::PyString (NameError)
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/parser/gherkin_builder.rb:95:in step' /opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/formatter/model.rb:129:inreplay'
/opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/formatter/filter_formatter.rb:130:in replay_events!' /opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/formatter/filter_formatter.rb:129:ineach'
/opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/formatter/filter_formatter.rb:129:in replay_events!' /opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/formatter/filter_formatter.rb:116:inreplay!'
/opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/formatter/filter_formatter.rb:44:in scenario' /opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/formatter/tag_count_formatter.rb:20:inscenario'
/opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/listener/formatter_listener.rb:37:in scenario' /opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/parser/parser.rb:46:insend'
/opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/parser/parser.rb:46:in method_missing' /opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/lexer/i18n_lexer.rb:23:inscan'
/opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/lexer/i18n_lexer.rb:23:in scan' /opt/local/lib/ruby/gems/1.8/gems/gherkin-2.4.0/lib/gherkin/parser/parser.rb:31:inparse'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/feature_file.rb:37:in parse' /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/runtime/features_loader.rb:28:inload'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/runtime/features_loader.rb:26:in each' /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/runtime/features_loader.rb:26:inload'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/runtime/features_loader.rb:14:in features' /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/runtime.rb:132:infeatures'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/runtime.rb:45:in run!' /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/cli/main.rb:43:inexecute!'
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/../lib/cucumber/cli/main.rb:20:in execute' /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.10.3/bin/cucumber:14 /Users/jason/.gem/ruby/1.8/bin/cucumber:19:inload'
/Users/jason/.gem/ruby/1.8/bin/cucumber:19
rake aborted!
Command failed with status (1): [/opt/local/bin/ruby -S bundle exec cucumbe...]

Tasks: TOP => cucumber => cucumber:ok
(See full trace by running task with --trace)

Cucumber 0.8.5 does not work with rake 0.9.2

This is what i see:

rake aborted!
uninitialized constant Cucumber::Rake::Task::ForkedCucumberRunner::RUBY

There are a lot of mentions of the deprecated DSL earlier. So i've got a patch coming which should fix the problem.

cucumber mistakenly tries to use arguments that do not refer to a file or diretory

Sometimes I provide an invalid argument to cucumber (e.g maybe I forget the -p flag and just use a profile name, eg "no_regression"):

cuucmber no_regression

Instead of cucumber reporting something like "no such file no_regression", the code in cucumber-0.10.0/lib/cucumber/cli/configuration.rb#feature_dirs will just add the dirname of my invalid argument to the list of feature dirs.

Particularly bad when there is no "/" in the argument, since the dirname is simply "." which is a perfectly valid (but wrong) folder.

At best this is an incorrect ignoring on an invalid argument, at worst (as was my case), it causes ruby files to be loaded twice that should not be loaded twice (since it's including the entire current directory), and cucumber explodes in a completely unintelligible way instead of simply telling me that my argument made no sense.

Recent change to junit.rb breaks on Windows

The recent update to the junit formatter only works on Unix.
The change hard coded / as the path separator.
On windows its \
Result is that junit.rb fails to find the relative path of the feature files relative to the features/ directory.
And it also fails to substitute all remaining path separators for underscore.
This in turn causes it to fail to create output XML file on Windows XML.

At least one fix is this ...

def basename(feature_file)
ext_length = File.extname(feature_file).length
# get the path rel to the features/ dir
rel_path = Pathname.new(feature_file).relative_path_from(Pathname.new("features"))
# substitute all remaining path separators (windows and *nix) for underscore
(""+rel_path).gsub(/[\/]/, '_')[0...-ext_length]
end

Junit formatter & same named features in multiple directories

The current Junit formatter code uses File.basename to create the output xml file name. As a result, if a project has two features with the same basename in different directories, only one of these will survive at the end of the CI run, and test counts will be wrong (and worse, failures could be ignored or hidden).

See github pull request cucumber/common#49 for a patch which addresses this issue.

original LH ticket

This ticket has 0 attachment(s).

Cucumber - Integration Testing ( Cuke4Duke) failing

I am getting following errors when execute mvn clean install or mvn integration-test. Any help would be appreciated. May be it looks like some of the library components are damaged.

|java.lang.NoClassDefFoundError: Ljavax/wsdl/Service; (NativeException)
[INFO] java/lang/Class.java:-2:in `getDeclaredFields0'
[INFO] java/lang/Class.java:2291:in `privateGetDeclaredFields'
[INFO] java/lang/Class.java:1743:in `getDeclaredFields'
[INFO] org/picocontainer/injectors/AdaptingInjection.java:217:in `run'
[INFO] java/security/AccessController.java:-2:in `doPrivileged'
[INFO] org/picocontainer/injectors/AdaptingInjection.java:210:in `injectionFieldAnnotated'
[INFO] org/picocontainer/injectors/AdaptingInjection.java:190:in `fieldAnnotatedInjectionAdapter'
[INFO] org/picocontainer/injectors/AdaptingInjection.java:59:in `createComponentAdapter'
[INFO] org/picocontainer/behaviors/AbstractBehaviorFactory.java:44:in `createComponentAdapter'
[INFO] org/picocontainer/behaviors/Caching.java:46:in `createComponentAdapter'
[INFO] org/picocontainer/DefaultPicoContainer.java:478:in `addComponent'
[INFO] org/picocontainer/DefaultPicoContainer.java:443:in `addComponent'
[INFO] org/picocontainer/DefaultPicoContainer.java:430:in `addComponent'
[INFO] cuke4duke/internal/jvmclass/PicoFactory.java:19:in `createObjects'
[INFO] cuke4duke/internal/jvmclass/ClassLanguage.java:67:in `begin_scenario'
[INFO] sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
[INFO] sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
[INFO] sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
[INFO] java/lang/reflect/Method.java:597:in `invoke'
[INFO] org/jruby/javasupport/JavaMethod.java:525:in `invokeDirectWithExceptionHandling'
[INFO] (__FORWARDABLE__):3:in `begin_scenario'

Javascript code is not being displayed in HTML output

TEST ENVIRONMENT
Cuke4Duke: 0.4.3
Cucumber: 0.10.2
Java: 1.6.0_24
OS: MacOS X 10.6.7

I am having difficulty getting cucumber to display the javascript code I have placed in the "Then" step. Please see the scenario listed below.

BEGIN SCENARIO

Scenario Outline: Scrape each xyz.com page for Google Analytics source code

Given the following xyz.com web page is loaded:
page
<page>
Then the following javascript code should exist within the page's source:
     """
     <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-23283112-3']);
        _gaq.push(['_trackPageview']);

        (function() {
          var ga = document.createElement('script'); ga.type =
      'text/javascript'; ga.async = true;
           ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
      'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(ga, s);
        })();

     </script>
     """

Examples
|page|
|/index.html|
|/about-us.html|
|/privacy.html|
|/terms.html|

END SCENARIO

Each of the scenarios pass just fine. The problem is that the step labled "Then the following javascript code should exist within the page's source:", should be followed by the actual javascript I'm verifying. If I run this from the console, the javascript displays just fine. However, if I run it with the following command "--format html --out my.html", the html file seems to mask the javascript (i.e., the javascript is not displayed when the HTML file is opened in a browser).

undefined method `process' for #<Capybara::RackTest::Driver:0xb589b5c4> (NoMethodError)

I'm getting this error consistently on some systems, and not at all on others. The weird thing about this (for me) is that these systems all run the same ubuntu version, and my rails dev environment is set up by a script to use the same rvm environment, and the same database. I really don't see how they could be different, but appearantly they are.

rename env.rb to boot.rb

This makes it more intentional what it's for, reducing risk of people putting all sort of gunk in here.
Also revisit require vs. load of stepdef and support files.

Strange error on rbx/rubinius

Original Lighthouse Ticket 715

Using rvm and rbx-1.0.1-20100603, cucumber 0.10.2 (latest as of today), I get a strange exception when running features:

Rake task:

Cucumber::Rake::Task.new(:features) do |t|
  t.cucumber_opts = "features --backtrace --verbose --format html -o #{CUKE_RESULTS} --format progress -x"
  t.fork = false
end

When I run rake --trace features, I get this:

** Invoke features (first_time)
** Execute features
Code:
  * features/support/env.rb
  * features/step_definitions/gli_executable_steps.rb
rake aborted!
no method '[]' on nil:NilClass.
kernel/delta/kernel.rb:85:in `[] (method_missing)'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/core_ext/proc.rb:16:in `file_colon_line'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_step_definition.rb:74:in `file_colon_line'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_step_definition.rb:34:in `initialize'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_language.rb:128:in `register_rb_step_definition'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_dsl.rb:27:in `register_rb_step_definition'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_dsl.rb:106:in `Given (register_rb_step_definition)'
    /Users/davec/Projects/gli/features/step_definitions/gli_executable_steps.rb:1:in `__script__'
    kernel/common/kernel.rb:642:in `load'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:176:in `load_file'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:78:in `load_files! {}'
    kernel/bootstrap/array.rb:163:in `each'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:77:in `load_files!'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:137:in `load_step_definitions'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:39:in `run!'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:43:in `execute!'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:20:in `execute'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rake/task.rb:49:in `run'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/cucumber-0.10.2/lib/cucumber/rake/task.rb:149:in `define_task {}'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:636:in `execute {}'
    kernel/bootstrap/array.rb:163:in `each'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain {}'
    /Users/davec/.rvm/rubies/rbx-1.0.1-20100603/lib/monitor.rb:191:in `synchronize (mon_synchronize)'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level {}'
    kernel/bootstrap/array.rb:163:in `each'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level {}'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:2001:in `run {}'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/gems/rake-0.8.7/bin/rake:31:in `__script__'
    kernel/common/kernel.rb:642:in `load'
    /Users/davec/.rvm/gems/rbx-1.0.1-20100603@gli-dev/bin/rake:19:in `__script__'
    kernel/delta/codeloader.rb:67:in `load_script'
    kernel/delta/codeloader.rb:91:in `load_script'
    kernel/loader.rb:435:in `script'
    kernel/loader.rb:527:in `main'
    kernel/loader.rb:553:in `main'
    kernel/loader.rb:565:in `__script__'

In trying to create a very simple set of features, I couldn't reproduce it, however I can reproduce it on my gli gem:

> git clone git://github.com/davetron5000/gli.git
> rake features
>

Here's my complete gem list:

> gem list

*** LOCAL GEMS ***

aruba (0.3.5)
builder (3.0.0)
bundler (1.0.12)
childprocess (0.1.8)
cucumber (0.10.2)
diff-lcs (1.1.2)
fakefs (0.3.1)
ffi (1.0.7)
gherkin (2.3.5)
gli (1.2.5)
json (1.5.1)
mysql2 (0.2.6)
rainbow (1.1.1)
rake (0.8.7)
rspec (2.5.0)
rspec-core (2.5.1)
rspec-expectations (2.5.0)
rspec-mocks (2.5.0)
sequel (3.21.0)
term-ansicolor (1.0.5)
terminal-table (1.4.2)

Pretty formatter is doing a puts where it should be doing an @io.puts

Relocated from https://rspec.lighthouseapp.com/projects/16211/tickets/699-pretty-formatter-is-doing-a-puts-where-it-should-be-doing-an-ioputs

Using cucumber 0.10.2, when I do something like:

buffer = StringIO.new
cuke = Cucumber::Cli::Main.new(['--dry-run', '--no-color', 'features/'], buffer)
cuke.execute!

I am seeing a lot of blank lines printed to STDOUT when I have a feature file with scenario outlines in it.
They appear to be coming from a puts on the first line of Cucumber::Formatter::Pretty#examples_name

Scenario without a body of steps to be Pending instead of Passing

Currently a Scenario without a body of steps is a passing scenario. Perhaps it should be a yellow pending scenario? Yes, there are still no steps that are passing or failing, but it'd be nice if it showed as yellow so you knew that there was still work to be done :)

Wire protocol handling of exceptions in hooks

It would be nice if exceptions in a Before or After hook over the wire protocol were handled the same way as with the Ruby language implementation. Today, I get either a long, irrelevant backtrace (from the Ruby side, not the backtrace passed over the wire) or it fails silently after the Scenario line is output. I'm not sure why I get one or the other at this point.

I've added a scenario in my fork to express the behavior I'd like: richardlawrence@4effaf1.

Deprecate and then remove keyword methods from World

Just try this:

Before { puts self.methods }

The World is polluted with hundreds of methods generated from all the different languages' step keywords. We should deprecate these, and direct people to simply use #steps instead.

cucumber 1.0.0 wrong number of arguments error when generating json format on jruby for windows

On jruby 1.6.2 for Windows, cucumber 1.0.0, json 1.5.3 java, json_pure 1.5.1, I get the following error trying to generate either json or json_pretty formats:

wrong number of arguments (1 for 0) (ArgumentError)
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/lib/cucumber/formatter/gherkin_formatter_adapter.rb:24:in `before_background'
org/jruby/RubyKernel.java:2063:in `send'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:174:in `send_to_all'
org/jruby/RubyArray.java:1602:in `each'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:172:in `send_to_all'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:56:in `visit_background'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/feature.rb:41:in `accept'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:20:in `visit_feature'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/features.rb:29:in `accept'
org/jruby/RubyArray.java:1602:in `each'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/features.rb:17:in `each'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/features.rb:28:in `accept'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:14:in `visit_features'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/runtime.rb:45:in `run!'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/cli/main.rb:43:in `execute!'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/../lib/cucumber/cli/main.rb:20:in `execute'
c:/jruby-1.6.2/lib/ruby/gems/1.8/gems/cucumber-1.0.0/bin/cucumber:14:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
c:\jruby-1.6.2\lib\ruby\gems\1.8\bin\cucumber:19:in `(root)'

Rename announce to puts

This way more people will stumble upon the feature. Also rename announce_world to puts(self) by overriding to_s on the world.

Table does not diff! successfully to itself

I am trying to use Table diff! to compare two tables that should compare equal, but they don't. I tried diffing the expected table to itself, and the diff still failed. The table looks like this:

  |[email protected]|[email protected]| ["user", "admin"] | edit | delete |
  |[email protected]|[email protected]| ["user"]          | edit | delete |
  |[email protected]|[email protected]| ["user"]          | edit | delete |

I am using Cucumber 0.10.2

Copied from Lighthouse ticket: https://rspec.lighthouseapp.com/projects/16211/tickets/721-cucumber-table-does-not-diff-successfully-to-itself#ticket-721-1

uninitialized constant Shoulda::Assertions (NameError)

Problem with versions 0.3.8 and 0.3.9 from cucumber.
With 0.3.5 works perfect.

Maybe a problem with Shoulda?

Error:

uninitialized constant Shoulda::Assertions (NameError)
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in load_missing_constant' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:inconst_missing'
/Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.10.1/lib/shoulda/action_controller.rb:22
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inpolyglot_original_require'
/Library/Ruby/Gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in require' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:158:inrequire'
/Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.10.1/lib/shoulda/rails.rb:6

Cucumber/Gherkin won't start under Jruby 1.6.1 in 1.9 mode

This bug was originally posted by mcornell on lighthouse.

Been trying to get Cucumber to run under JRuby 1.6.x in 1.9 mode so I can use 1.9 goodness.

I get the following error:

jruby --1.9 -S cucumber
C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/gherkin-2.3.5-java/lib/gherkin/i18n.rb:9 warning: already initialized constant FEATURE_ELEMENT_KEYS
C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/gherkin-2.3.5-java/lib/gherkin/i18n.rb:10 warning: already initialized constant STEP_KEYWORD_KEYS
C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/gherkin-2.3.5-java/lib/gherkin/i18n.rb:11 warning: already initialized constant KEYWORD_KEYS
LoadError: load error: gherkin/i18n -- org.yaml.snakeyaml.reader.ReaderException: special characters are not allowed
require at org/jruby/RubyKernel.java:1047 require at C:/tools/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 (root) at C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/gherkin-2.3.5-java/lib/gherkin/lexer/i18n_lexer.rb:1 require at org/jruby/RubyKernel.java:1047 require at C:/tools/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 (root) at C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/gherkin-2.3.5-java/lib/gherkin/lexer/i18n_lexer.rb:1 require at org/jruby/RubyKernel.java:1047 require at C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/gherkin-2.3.5-java/lib/gherkin.rb:29 (root) at C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/cli/main.rb:5 require at org/jruby/RubyKernel.java:1047 require at C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/cli/main.rb:29 (root) at C:/tools/jruby-1.6.1/lib/ruby/gems/1.8/gems/cucumber-0.10.2/bin/cucumber:11

 load at org/jruby/RubyKernel.java:1073
(root) at C:/tools/jruby-1.6.1/bin/cucumber:19

Not sure if this is a jruby problem or cucumber. It runs fine in 1.8.7 mode.

jruby -v
jruby 1.6.1 (ruby-1.9.2-p136) (2011-04-12 85838f6) (Java HotSpot(TM) Client VM 1.6.0_20) [Windows XP-x86-java]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.