Giter Club home page Giter Club logo

aruba's Introduction

#StandWithUkraine

Cucumber Common Components

Cucumber is made up of several libraries, many of which are kept in polyglot repositories, meaning we keep multiple language implementations of the same library together in the same repo.

Library Description Latest release
cucumber-expressions Pattern-matching for Gherkin steps Latest release
tag-expressions For parsing tag selection queries Latest release
gherkin Parser for Gherkin feature files Latest release
messages JSON message protocol Latest release
query Query API for messages Latest release
gherkin-utils API for querying parsed Gherkin documents Latest release

If you're not sure which repository your issue belongs under, or it cuts across multiple repos, raise it in this repo.

aruba's People

Contributors

amatsuda avatar aslakhellesoy avatar aurelien-reeves avatar dchelimsky avatar deivid-rodriguez avatar dependabot[bot] avatar e2 avatar hectcastro avatar jarl-dk avatar jasnow avatar jonrowe avatar junaruga avatar limhoff-r7 avatar luke-hill avatar mattwynne avatar maxmeyer avatar msassak avatar mvz avatar mxygem avatar njam avatar olleolleolle avatar os97673 avatar renovate[bot] avatar robertwahler avatar rspeicher avatar scottj97 avatar simonharrer avatar taylor avatar utkarsh2102 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

aruba's Issues

Aruba.version to return version number

If, as intended a library uses Aruba's steps, then to document the combined available steps in a feature the following step definition is required:

Then /^these steps are defined:$/ do |table|
  rsc = ::Cucumber::Runtime::SupportCode.new 'ui', :autoload_code_paths => 'lib/cuken/cucumber'
  rsc.load_files! ['lib/cuken/cucumber/file.rb', "#{ENV['GEM_HOME']}/gems/aruba-0.3.3/lib/aruba/cucumber.rb"]
  sd_array = rsc.step_definitions
  table.hashes.each do |hsh|
    sd_array.each{|sd| res = sd.regexp_source == %Q{/^#{hsh['step']}$/}; break if res}
  end
end

It is possible to avoid hard coding the Aruba version number, if Aruba.version returns the version string.

Make @announce also work for file operations

Currently the @announce tags do not work for file operations. It would be very helpful if they printed where Aruba created a file etc. It would also be nice if @announce could print the Aruba configuration so that it's easier to figure out what directory is used, e.g. tmp/aruba.

incomplete data returned by repo.config.keys in a cucumber step

aruba 0.2.4, cucumber 0.9.3 on 1.9.2p0

The following step retrieves an incomplete list of config data, i.e. length of 14

Given /^I configured git sanely$/ do
  puts "This is the project folder: #{@active_project_folder}"
  @repo = Grit::Repo.new(@active_project_folder)
  ['user.name', 'user.email', 'github.user', 'github.token'].each do |k|
    puts @repo.config.keys.length
    @repo.config.fetch(k).should_not raise
  end
end

The stack trace is:

IndexError: key not found
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/grit-2.3.0/lib/grit/config.rb:18:in `fetch'
/usr/src/fog/features/step_definitions/vcs_steps.rb:7:in `block (2 levels) in <top (required)>'
/usr/src/fog/features/step_definitions/vcs_steps.rb:4:in `each'
/usr/src/fog/features/step_definitions/vcs_steps.rb:4:in `block in <top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/step_match.rb:26:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_invocation.rb:63:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_invocation.rb:42:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:15:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:14:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:14:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:53:in `block (2 levels) in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:77:in `block (2 levels) in with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:93:in `before_and_after'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:76:in `block in with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:115:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:115:in `block (3 levels) in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:13:in `block in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:95:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:95:in `execute_around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:12:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:114:in `block (2 levels) in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:112:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:112:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:88:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:75:in `with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:51:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:106:in `with_visitor'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:45:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:51:in `block in visit_feature_element'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:35:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:34:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:34:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:29:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:17:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:17:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:28:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:43:in `run!'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/cli/main.rb:48:in `execute!'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/cli/main.rb:21:in `execute'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/bin/cucumber:8:in `<top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/bin/cucumber:19:in `load'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/bin/cucumber:19:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
/usr/src/fog/features/vcs/vcs.feature:9:in `When I configured git sanely'

The print output, without the .should test is:

This is the project folder: /usr/src/fog
14
14
14
14

Finally just to confirm that Grit is not the issue and that all is OK in the repo, everything works fine from bash:

$ irb
ruby-1.9.2-p0 > require 'grit'
 => true     
ruby-1.9.2-p0 > @repo=Grit::Repo.new('/usr/src/fog')
 => #<Grit::Repo "/usr/src/fog/.git">    
ruby-1.9.2-p0 > ['user.name', 'user.email', 'github.user', 'github.token'].each do |k|
ruby-1.9.2-p0 >          puts @repo.config.keys
ruby-1.9.2-p0 ?>       @repo.config.fetch(k)
ruby-1.9.2-p0 ?>  end
user.name
user.email
github.user
github.token
color.branch
color.diff
color.interactive
color.status
alias.ci
alias.ciall
alias.unmerge
alias.st
alias.stat
alias.lsbr
alias.mkbr
alias.rmbr
alias.mvbr
alias.track
alias.lstag
alias.mktag
alias.rmtag
alias.mvtag
alias.mkrem
alias.lsrem
alias.spull
alias.modinit
alias.modup
alias.modst
alias.modadd
alias.recentlog
alias.osspush
alias.osspull
alias.osssync
alias.k
alias.gitkconflict
alias.stage
merge.conflictstyle
merge.tool
gui.recentrepo
branch.autosetupmerge
mergetool.kdiff3.cmd
mergetool.kdiff3.trustexitcode
diff.tool
difftool.kdiff3.cmd
core.repositoryformatversion
core.filemode
core.bare
core.logallrefupdates
remote.origin.fetch
remote.origin.url
branch.master.remote
branch.master.merge
remote.upstream.url
remote.upstream.fetch
branch.bundler.remote
branch.bundler.merge
branch.simult_specs.remote
branch.simult_specs.merge
<snip repeats>
 => ["user.name", "user.email", "github.user", "github.token"]

[patch] directory should not exist gives false-positive

Ran across this during use, it's an easy fix, just the wrong method being called (checked for file instead of directory).

Have added test coverage for it, but you may want to change how I've made it expect an error is raised. I saw you have a similar step already but it doesn't handle multiline step input (I think?) so added something simple instead of changing what's there already.

http://github.com/nruth/aruba/commit/ff158bb7ceb5512bdc252556e2ddafa88bc1d889
http://github.com/nruth/aruba/commits/dir_should_not_exist

Cannot get Aruba features to pass.

When I run rake features on a git clone of aruba-0.1.9 I see this:

  Scenario: Run with ruby 1.9.1              # features/running_ruby.feature:7
    Given I am using rvm "1.9.1"             # lib/aruba/cucumber.rb:27
    When I run "ruby -e 'puts RUBY_VERSION'" # lib/aruba/cucumber.rb:60
      $ rvm 1.9.1 ruby -e 'puts RUBY_VERSION'
      
      sh: rvm: command not found
      
    Then I should see "ruby-1.9.1-p378"      # lib/aruba/cucumber.rb:68
      expected: /ruby\-1\.9\.1\-p378/,
           got:  .  .  .

However, this works from the command line. I

$ rvm 1.9.1 ruby -e 'puts RUBY_VERSION'
ruby-1.9.1-p378: ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux] 
1.9.1

Is this feature not yet passing in the master or do I have some sort of local configuration issue?

The file should contain "regex"

There's a good chance that I'm being dense, but the file content matching regular expression steps don't work.

For example:
Scenario: Example
Given a file named "output.txt" with:
"""
1111111
"""
Then the file "output.txt" should contain "1+"

Fails:
Then the file "output.txt" should contain "1+" # 1.8.6-p399/gems/aruba-0.1.9/lib/aruba/cucumber.rb:145
expected "1111111" to match /1+/ (Spec::Expectations::ExpectationNotMetError)
features/counter.feature:25:in `Then the file "output.txt" should contain "1+"'

If I want to match a regular expression, why would I want Aruba to escape the expression I provide?

Would you expect the following scenario to pass?
Scenario: Check file contents
Given a file named "foo" with:
"""
hello world
"""
Then the file "foo" should contain "h.llo world"
And the file "foo" should not contain "HELLO WORLD"

When I run "non-existent-command" passes (even though there is no command called non-existent-command)

Hopefully the title says it all, but here's the detailed feature to try:

Feature: run exe
as a user i'd like to run the exe'

Scenario: Run exe
    When I run "test_exe"
    Then I should see:
    """
    Hello World!
    """

The when step passes with aruba 0.2.4, cucumber 0.9.4, ruby 1.8.7 patch 249.

Setting the @announce tag will show the stderr output indicating test_exe is not found. Shouldn't this be shown without the tag, instead of having the step pass?

"I type" step doesn't work with Readline

the CLI I'm trying to test asks for some text through Readline, so when I do something like this:

  When I run "mybin --option" (runs Readline to ask the user for some text)

Aruba executes the When but it hangs there, I need to do Ctrl-C twice to exit.

What should I do to make it work with Readline?

background_process does does not flush $stdout

When testing a background process that streams significant amounts of data to $stdout the test eventually blocks on a write to $stdout and the test process halts indefinitely. This problem is a result of the switch to the background_process gem to implement the run command. An issue respecting this matter has been raised with the gem author

http://github.com/timcharper/background_process/issues#issue/2

but no response has been forthcoming.

Attempts to work around this matter by manually flushing $stdout in the test process itself has no effect on the behaviour of the test. Initially I thought that this was strictly a Ruby-1.9.2 problem as all tests passed when run under 1.8.7. However, by slightly increasing the amount of data sent to $stdout the problem also arises in Ruby-1.8.7.

While this is, strictly speaking, a problem with the background_process gem itself, its presence makes the use of it in aruba somewhat problematic.

Then (only) these directories|files (do not) exist:

In describing the outcomes the following is succinct:
Then (only) these directories (do not) exist:
Then (only) these files (do not) exist:

Rather than:
Then the following directories should (not) exist:

The only modification is important in many cases

Use local commands

Didn't think about this until working on Spork, where you want to use the local binary. (Unlike, say, working on cucumber-rails, where the relevant binaries come from other projects.)

Currently I'm putting this at the top of Spork's env.rb:

ENV["PATH"] = File.expand_path(File.dirname(__FILE__) + "/../../bin") << ":" << ENV["PATH"]

This is to avoid any facepalm moments in future where I change Spork code and don't re-install the gem. Question is, does Aruba need a step for this or an API means of making it easy? eg

Given $PATH includes "bin"

(which I don't like)

0.2.7 breaks things and should have been named 0.3.0

I used 0.2.4 and then updated to 0.2.7 expecting a compatible API since both are in the 0.2.x range. However, 0.2.7 (or some version between 0.2.4 and 0.2.7) breaks compatibility:

require 'aruba'  

is suddenly no-op, and several of the "the output should contain" steps unescape the strings, which gives me weird errors (I've added a separate issue for this).

I realize that there's nothing you can do about this at this point, but could you please be more careful with versions in the future? The '~>' specifier in Rubygems is supposed to protect against incompatible versions, but it's useless when versions don't reflect API changes.

childprocess slower than background_process

After the switch to childprocess things are a lot slower. Compare cucumber's own features running with aruba 0.2.7 and 0.2.8:

aruba 0.2.7:

$ time cucumber features

26 scenarios (26 passed)
184 steps (184 passed)
0m19.330s

real    0m19.889s
user    0m15.434s
sys 0m3.922s

aruba 0.2.8:

$ time cucumber features

26 scenarios (26 passed)
184 steps (184 passed)
0m31.335s

real    0m31.895s
user    0m15.438s
sys 0m4.017s

Also see comment in #41 - the slowness is observable in aruba too. Since I'm running on OS X I'm not sure why things are slower - I suppose both background_process and childprocess use the same fork etc. methods? Or not?

Please close this issue if this can be resolved with a patch to childprocess.

Failing 6 tests because of getting nil exit status

With 'rake cucumber', I get 6 failures because of getting nil exit statuses. Below is the full output. I also noticed that if I run 'cucumber features' instead, all the 55 scenarios pass. Is that expected?

(in /home/hagabaka/aruba)
Using the default profile...
Feature: Flushing output
  In order to test processes that output a lot of data
  As a developer using Aruba
  I want to make sure that large amounts of output aren't buffered

  Scenario: A little output                   # features/flushing.feature:7
    When I run "ruby -e 'puts :a.to_s * 256'" # lib/aruba/cucumber.rb:94
    Then the output should contain "a"        # lib/aruba/cucumber.rb:110
    And the output should be 256 bytes long   # features/step_definitions/aruba_dev_steps.rb:22
    And the exit status should be 0           # lib/aruba/cucumber.rb:154
      expected: 0,
           got: nil (using ==) (RSpec::Expectations::ExpectationNotMetError)
      ./lib/aruba/cucumber.rb:155:in `/^the exit status should be (\d+)$/'
      features/flushing.feature:11:in `And the exit status should be 0'

  Scenario: Tons of output                      # features/flushing.feature:13
    When I run "ruby -e 'puts :a.to_s * 65536'" # lib/aruba/cucumber.rb:94
    Then the output should contain "a"          # lib/aruba/cucumber.rb:110
    And the output should be 65536 bytes long   # features/step_definitions/aruba_dev_steps.rb:22

  # And the exit status should be 0
  Scenario: Tons of interactive output                                             # features/flushing.feature:19
    When I run "ruby -e 'len = gets.chomp; puts :a.to_s * len.to_i'" interactively # lib/aruba/cucumber.rb:102
    And I type "65536"                                                             # lib/aruba/cucumber.rb:106
    Then the output should contain "a"                                             # lib/aruba/cucumber.rb:110
    And the output should be 65536 bytes long                                      # features/step_definitions/aruba_dev_steps.rb:22

Feature: file system commands
  In order to specify commands that load files
  As a developer using Cucumber
  I want to create temporary files

  Scenario: create a dir                         # features/file_system_commands.feature:7
    Given a directory named "foo/bar"            # lib/aruba/cucumber.rb:62
    When I run "ruby -e \"puts test ?d, 'foo'\"" # lib/aruba/cucumber.rb:94
    Then the stdout should contain "true"        # lib/aruba/cucumber.rb:187

  Scenario: create a file                         # features/file_system_commands.feature:12
    Given a file named "foo/bar/example.rb" with: # lib/aruba/cucumber.rb:66
      """
      puts "hello world"
      """
    When I run "ruby foo/bar/example.rb"          # lib/aruba/cucumber.rb:94
    Then the output should contain "hello world"  # lib/aruba/cucumber.rb:110

  Scenario: append to a file                          # features/file_system_commands.feature:20
    Given a file named "foo/bar/example.rb" with:     # lib/aruba/cucumber.rb:66
      """
      puts "hello world"
      """
    When I append to "foo/bar/example.rb" with:       # lib/aruba/cucumber.rb:82
      """
      puts "this was appended"
      """
    When I run "ruby foo/bar/example.rb"              # lib/aruba/cucumber.rb:94
    Then the output should contain "hello world"      # lib/aruba/cucumber.rb:110
    And the output should contain "this was appended" # lib/aruba/cucumber.rb:110

  Scenario: clean up files generated in previous scenario                           # features/file_system_commands.feature:33
    When I run "ruby foo/bar/example.rb"                                            # lib/aruba/cucumber.rb:94
    Then the exit status should be 1                                                # lib/aruba/cucumber.rb:154
    And the output should contain "No such file or directory -- foo/bar/example.rb" # lib/aruba/cucumber.rb:110

  Scenario: change to a subdir                    # features/file_system_commands.feature:38
    Given a file named "foo/bar/example.rb" with: # lib/aruba/cucumber.rb:66
      """
      puts "hello world"
      """
    When I cd to "foo/bar"                        # lib/aruba/cucumber.rb:90
    And I run "ruby example.rb"                   # lib/aruba/cucumber.rb:94
    Then the output should contain "hello world"  # lib/aruba/cucumber.rb:110

  Scenario: Reset current directory from previous scenario # features/file_system_commands.feature:47
    When I run "ruby example.rb"                           # lib/aruba/cucumber.rb:94
    Then the exit status should be 1                       # lib/aruba/cucumber.rb:154

  Scenario: Holler if cd to bad dir                                            # features/file_system_commands.feature:51
    Given a file named "foo/bar/example.rb" with:                              # lib/aruba/cucumber.rb:66
      """
      puts "hello world"
      """
    When I do aruba I cd to "foo/nonexistant"                                  # features/step_definitions/aruba_dev_steps.rb:1
    Then aruba should fail with "tmp/aruba/foo/nonexistant is not a directory" # features/step_definitions/aruba_dev_steps.rb:14

  Scenario: Check for presence of a subset of files # features/file_system_commands.feature:59
    Given an empty file named "lorem/ipsum/dolor"   # lib/aruba/cucumber.rb:70
    Given an empty file named "lorem/ipsum/sit"     # lib/aruba/cucumber.rb:70
    Given an empty file named "lorem/ipsum/amet"    # lib/aruba/cucumber.rb:70
    Then the following files should exist:          # lib/aruba/cucumber.rb:223
      | lorem/ipsum/dolor |
      | lorem/ipsum/amet  |

  Scenario: Check for absence of files         # features/file_system_commands.feature:67
    Then the following files should not exist: # lib/aruba/cucumber.rb:227
      | lorem/ipsum/dolor |

  Scenario: Check for presence of a single file        # features/file_system_commands.feature:71
    Given an empty file named "lorem/ipsum/dolor"      # lib/aruba/cucumber.rb:70
    Then a file named "lorem/ipsum/dolor" should exist # lib/aruba/cucumber.rb:231

  Scenario: Check for absence of a single file             # features/file_system_commands.feature:75
    Then a file named "lorem/ipsum/dolor" should not exist # lib/aruba/cucumber.rb:235

  Scenario: Check for presence of a subset of directories # features/file_system_commands.feature:78
    Given a directory named "foo/bar"                     # lib/aruba/cucumber.rb:62
    Given a directory named "foo/bla"                     # lib/aruba/cucumber.rb:62
    Then the following directories should exist:          # lib/aruba/cucumber.rb:239
      | foo/bar |
      | foo/bla |

  Scenario: check for absence of directories                                             # features/file_system_commands.feature:85
    Given a directory named "foo/bar"                                                    # lib/aruba/cucumber.rb:62
    Given a directory named "foo/bla"                                                    # lib/aruba/cucumber.rb:62
    Then the following step should fail with Spec::Expectations::ExpectationNotMetError: # features/step_definitions/aruba_dev_steps.rb:18
      """
      Then the following directories should not exist:
        | foo/bar/ |
        | foo/bla/ |
      """

  Scenario: Check for presence of a single directory # features/file_system_commands.feature:95
    Given a directory named "foo/bar"                # lib/aruba/cucumber.rb:62
    Then a directory named "foo/bar" should exist    # lib/aruba/cucumber.rb:247

  Scenario: Check for absence of a single directory                                      # features/file_system_commands.feature:99
    Given a directory named "foo/bar"                                                    # lib/aruba/cucumber.rb:62
    Then the following step should fail with Spec::Expectations::ExpectationNotMetError: # features/step_definitions/aruba_dev_steps.rb:18
      """
      Then a directory named "foo/bar" should not exist
      """

  Scenario: Check file contents                         # features/file_system_commands.feature:106
    Given a file named "foo" with:                      # lib/aruba/cucumber.rb:66
      """
      hello world
      """
    Then the file "foo" should contain "hello world"    # lib/aruba/cucumber.rb:255
    And the file "foo" should not contain "HELLO WORLD" # lib/aruba/cucumber.rb:259

  Scenario: Check file contents with regexp           # features/file_system_commands.feature:114
    Given a file named "foo" with:                    # lib/aruba/cucumber.rb:66
      """
      hello world
      """
    Then the file "foo" should match /hel.o world/    # lib/aruba/cucumber.rb:267
    And the file "foo" should not match /HELLO WORLD/ # lib/aruba/cucumber.rb:271

  Scenario: Remove file                  # features/file_system_commands.feature:122
    Given a file named "foo" with:       # lib/aruba/cucumber.rb:66
      """
      hello world
      """
    When I remove the file "foo"         # lib/aruba/cucumber.rb:86
    Then the file "foo" should not exist # lib/aruba/cucumber.rb:219

Feature: Interactive process control
  In order to test interactive command line applications
  As a developer using Cucumber
  I want to use the interactive session steps

  Scenario: Running ruby interactively      # features/interactive.feature:7
    Given a file named "echo.rb" with:      # lib/aruba/cucumber.rb:66
      """
      while res = gets.chomp
        break if res == "quit"
        puts res.reverse
      end
      """
    When I run "ruby echo.rb" interactively # lib/aruba/cucumber.rb:102
    And I type "hello, world"               # lib/aruba/cucumber.rb:106
    And I type "quit"                       # lib/aruba/cucumber.rb:106
    Then the output should contain:         # lib/aruba/cucumber.rb:126
      """
      dlrow ,olleh
      """

  Scenario: Running a native binary interactively # features/interactive.feature:23
    When I run "bc -q" interactively              # lib/aruba/cucumber.rb:102
    And I type "4 + 3"                            # lib/aruba/cucumber.rb:106
    And I type "quit"                             # lib/aruba/cucumber.rb:106
    Then the output should contain:               # lib/aruba/cucumber.rb:126
      """
      7
      """

  Scenario: Stop processes before checking for filesystem changes          # features/interactive.feature:32
    See: http://github.com/aslakhellesoy/aruba/issues#issue/17 for context
    Given a directory named "rename_me"                                    # lib/aruba/cucumber.rb:62
    When I run "mv rename_me renamed" interactively                        # lib/aruba/cucumber.rb:102
    Then a directory named "renamed" should exist                          # lib/aruba/cucumber.rb:247
    And a directory named "rename_me" should not exist                     # lib/aruba/cucumber.rb:251

Feature: exit statuses
  In order to specify expected exit statuses
  As a developer using Cucumber
  I want to use the "the exit status should be" step

  Scenario: exit status of 0         # features/exit_statuses.feature:7
    When I run "ruby -h"             # lib/aruba/cucumber.rb:94
    Then the exit status should be 0 # lib/aruba/cucumber.rb:154

  Scenario: Not explicitly exiting at all # features/exit_statuses.feature:11
    When I run "ruby -e '42'"             # lib/aruba/cucumber.rb:94
    Then the exit status should be 0      # lib/aruba/cucumber.rb:154
      expected: 0,
           got: nil (using ==) (RSpec::Expectations::ExpectationNotMetError)
      ./lib/aruba/cucumber.rb:155:in `/^the exit status should be (\d+)$/'
      features/exit_statuses.feature:13:in `Then the exit status should be 0'

  Scenario: non-zero exit status        # features/exit_statuses.feature:15
    When I run "ruby -e 'exit 56'"      # lib/aruba/cucumber.rb:94
    Then the exit status should be 56   # lib/aruba/cucumber.rb:154
      expected: 56,
           got: nil (using ==) (RSpec::Expectations::ExpectationNotMetError)
      ./lib/aruba/cucumber.rb:155:in `/^the exit status should be (\d+)$/'
      features/exit_statuses.feature:17:in `Then the exit status should be 56'
    And the exit status should not be 0 # lib/aruba/cucumber.rb:158

  Scenario: Successfully run something         # features/exit_statuses.feature:20
    When I successfully run "ruby -e 'exit 0'" # lib/aruba/cucumber.rb:98
      Exit status was . Output:
       (RuntimeError)
      ./lib/aruba/api.rb:221:in `run_simple'
      ./lib/aruba/cucumber.rb:99:in `/^I successfully run "(.*)"$/'
      features/exit_statuses.feature:21:in `When I successfully run "ruby -e 'exit 0'"'

  Scenario: Unsuccessfully run something                   # features/exit_statuses.feature:23
    When I do aruba I successfully run "ruby -e 'exit 10'" # features/step_definitions/aruba_dev_steps.rb:1
    Then aruba should fail with "Exit status was 10"       # features/step_definitions/aruba_dev_steps.rb:14
      expected "Exit status was . Output:\n" to include "Exit status was 10" (RSpec::Expectations::ExpectationNotMetError)
      ./features/step_definitions/aruba_dev_steps.rb:15:in `/^aruba should fail with "([^"]*)"$/'
      features/exit_statuses.feature:25:in `Then aruba should fail with "Exit status was 10"'

  Scenario: Try to run something that doesn't exist # features/exit_statuses.feature:27
    When I run "does_not_exist"                     # lib/aruba/cucumber.rb:94
    Then the exit status should be 1                # lib/aruba/cucumber.rb:154

Feature: Output
  In order to specify expected output
  As a developer using Cucumber
  I want to use the "the output should contain" step

  Scenario: Run unknown command       # features/output.feature:7
    When I run "neverever gonna work" # lib/aruba/cucumber.rb:94
    Then the output should contain:   # lib/aruba/cucumber.rb:126
      """
      No such file or directory - neverever gonna work
      """

  Scenario: Detect subset of one-line output     # features/output.feature:14
    When I run "ruby -e 'puts \"hello world\"'"  # lib/aruba/cucumber.rb:94
    Then the output should contain "hello world" # lib/aruba/cucumber.rb:110

  Scenario: Detect subset of one-line output     # features/output.feature:18
    When I run "echo 'hello world'"              # lib/aruba/cucumber.rb:94
    Then the output should contain "hello world" # lib/aruba/cucumber.rb:110

  Scenario: Detect absence of one-line output     # features/output.feature:22
    When I run "ruby -e 'puts \"hello world\"'"   # lib/aruba/cucumber.rb:94
    Then the output should not contain "good-bye" # lib/aruba/cucumber.rb:122

  Scenario: Detect subset of multiline output     # features/output.feature:26
    When I run "ruby -e 'puts \"hello\\nworld\"'" # lib/aruba/cucumber.rb:94
    Then the output should contain:               # lib/aruba/cucumber.rb:126
      """
      hello
      """

  Scenario: Detect subset of multiline output     # features/output.feature:33
    When I run "ruby -e 'puts \"hello\\nworld\"'" # lib/aruba/cucumber.rb:94
    Then the output should not contain:           # lib/aruba/cucumber.rb:130
      """
      good-bye
      """

  Scenario: Detect exact one-line output                   # features/output.feature:40
    When I run "ruby -e 'puts \"hello world\"'"            # lib/aruba/cucumber.rb:94
    Then the output should contain exactly "hello world\n" # lib/aruba/cucumber.rb:134

  Scenario: Detect exact multiline output         # features/output.feature:44
    When I run "ruby -e 'puts \"hello\\nworld\"'" # lib/aruba/cucumber.rb:94
    Then the output should contain exactly:       # lib/aruba/cucumber.rb:138
      """
      hello
      world

      """

  @announce
  Scenario: Detect subset of one-line output with regex                   # features/output.feature:54
    When I run "ruby --version"                                           # lib/aruba/cucumber.rb:94
      $ cd /home/hagabaka/aruba/tmp/aruba
      $ /usr/bin/ruby --version
      ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

    Then the output should contain "ruby"                                 # lib/aruba/cucumber.rb:110
    And the output should match /ruby ([\d]+\.[\d]+\.[\d]+)(p\d+)? \(.*$/ # lib/aruba/cucumber.rb:146

  @announce
  Scenario: Detect subset of multiline output with regex                                       # features/output.feature:60
    When I run "ruby -e 'puts \"hello\\nworld\\nextra line1\\nextra line2\\nimportant line\"'" # lib/aruba/cucumber.rb:94
      $ cd /home/hagabaka/aruba/tmp/aruba
      $ /usr/bin/ruby -e 'puts "hello\nworld\nextra line1\nextra line2\nimportant line"'
      hello
      world
      extra line1
      extra line2
      important line

    Then the output should match:                                                              # lib/aruba/cucumber.rb:150
      """
      he..o
      wor.d
      .*
      important line
      """

  @announce
  Scenario: Match passing exit status and partial output # features/output.feature:71
    When I run "ruby -e 'puts \"hello\\nworld\"'"        # lib/aruba/cucumber.rb:94
      $ cd /home/hagabaka/aruba/tmp/aruba
      $ /usr/bin/ruby -e 'puts "hello\nworld"'
      hello
      world

    Then it should pass with:                            # lib/aruba/cucumber.rb:162
      """
      hello
      """

  Scenario: Match passing exit status and exact output # features/output.feature:78
    When I run "ruby -e 'puts \"hello\\nworld\"'"      # lib/aruba/cucumber.rb:94
    Then it should pass with exactly:                  # lib/aruba/cucumber.rb:166
      """
      hello
      world

      """
      expected: 0,
           got: nil (using ==) (RSpec::Expectations::ExpectationNotMetError)
      ./lib/aruba/api.rb:168:in `assert_exiting_with'
      ./lib/aruba/api.rb:163:in `assert_exit_status_and_output'
      ./lib/aruba/cucumber.rb:167:in `/^it should (pass|fail) with exactly:$/'
      features/output.feature:80:in `Then it should pass with exactly:'

  @announce-stdout
  Scenario: Match failing exit status and partial output  # features/output.feature:88
    When I run "ruby -e 'puts \"hello\\nworld\";exit 99'" # lib/aruba/cucumber.rb:94
      hello
      world
    Then it should fail with:                             # lib/aruba/cucumber.rb:162
      """
      hello
      """

  Scenario: Match failing exit status and exact output    # features/output.feature:95
    When I run "ruby -e 'puts \"hello\\nworld\";exit 99'" # lib/aruba/cucumber.rb:94
    Then it should fail with exactly:                     # lib/aruba/cucumber.rb:166
      """
      hello
      world

      """

  @announce-stdout
  Scenario: Match failing exit status and output with regex # features/output.feature:105
    When I run "ruby -e 'puts \"hello\\nworld\";exit 99'"   # lib/aruba/cucumber.rb:94
      hello
      world
    Then it should fail with regex:                         # lib/aruba/cucumber.rb:170
      """
      hello\s*world
      """

  @announce-cmd
  Scenario: Match output in stdout                # features/output.feature:113
    When I run "ruby -e 'puts \"hello\\nworld\"'" # lib/aruba/cucumber.rb:94
      $ /usr/bin/ruby -e 'puts "hello\nworld"'
    Then the stdout should contain "hello"        # lib/aruba/cucumber.rb:187
    Then the stderr should not contain "hello"    # lib/aruba/cucumber.rb:195

  @announce-stderr
  Scenario: Match output in stderr                               # features/output.feature:119
    When I run "ruby -e 'STDERR.puts \"hello\\nworld\";exit 99'" # lib/aruba/cucumber.rb:94
      hello
      world
    Then the stderr should contain "hello"                       # lib/aruba/cucumber.rb:179
    Then the stdout should not contain "hello"                   # lib/aruba/cucumber.rb:199

  Scenario: Detect output from all processes                    # features/output.feature:124
    When I run "ruby -e 'puts \"hello world!\"'"                # lib/aruba/cucumber.rb:94
    And I run "ruby -e 'puts gets.chomp.reverse'" interactively # lib/aruba/cucumber.rb:102
    And I type "hello"                                          # lib/aruba/cucumber.rb:106
    Then the output should contain exactly:                     # lib/aruba/cucumber.rb:138
      """
      hello world!
      olleh

      """

  Scenario: Detect stdout from all processes                    # features/output.feature:135
    When I run "ruby -e 'puts \"hello world!\"'"                # lib/aruba/cucumber.rb:94
    And I run "ruby -e 'puts gets.chomp.reverse'" interactively # lib/aruba/cucumber.rb:102
    And I type "hello"                                          # lib/aruba/cucumber.rb:106
    Then the stdout should contain "hello world!\nolleh"        # lib/aruba/cucumber.rb:187
    And the stderr should not contain "hello world!\nolleh"     # lib/aruba/cucumber.rb:195

  Scenario: Detect stderr from all processes                           # features/output.feature:142
    When I run "ruby -e 'STDERR.puts \"hello world!\"'"                # lib/aruba/cucumber.rb:94
    And I run "ruby -e 'STDERR.puts gets.chomp.reverse'" interactively # lib/aruba/cucumber.rb:102
    And I type "hello"                                                 # lib/aruba/cucumber.rb:106
    Then the stderr should contain "hello world!\nolleh"               # lib/aruba/cucumber.rb:179
    And the stdout should not contain "hello world!\nolleh"            # lib/aruba/cucumber.rb:199

  Scenario: Detect output from named source                                     # features/output.feature:149
    When I run "ruby -e 'puts :simple'"                                         # lib/aruba/cucumber.rb:94
    And I run "ruby -e 'puts gets.chomp'" interactively                         # lib/aruba/cucumber.rb:102
    And I type "interactive"                                                    # lib/aruba/cucumber.rb:106
    Then the output from "ruby -e 'puts :simple'" should contain "simple"       # lib/aruba/cucumber.rb:114
    And the output from "ruby -e 'puts gets.chomp'" should not contain "simple" # lib/aruba/cucumber.rb:118

  Scenario: Detect stdout from named source                                  # features/output.feature:156
    When I run "ruby -e 'puts :hello'"                                       # lib/aruba/cucumber.rb:94
    And I run "ruby -e 'puts :goodbye'"                                      # lib/aruba/cucumber.rb:94
    Then the stdout from "ruby -e 'puts :hello'" should contain "hello"      # lib/aruba/cucumber.rb:203
    And the stderr from "ruby -e 'puts :hello'" should not contain "hello"   # lib/aruba/cucumber.rb:215
    And the stdout from "ruby -e 'puts :goodbye'" should not contain "hello" # lib/aruba/cucumber.rb:207

  Scenario: Detect stderr from named source                                       # features/output.feature:163
    When I run "ruby -e 'STDERR.puts :hello'"                                     # lib/aruba/cucumber.rb:94
    And I run "ruby -e 'puts :goodbye'"                                           # lib/aruba/cucumber.rb:94
    Then the stderr from "ruby -e 'STDERR.puts :hello'" should contain "hello"    # lib/aruba/cucumber.rb:211
    And the stdout from "ruby -e 'STDERR.puts :hello'" should not contain "hello" # lib/aruba/cucumber.rb:207
    And the stderr from "ruby -e 'puts :goodbye'" should not contain "hello"      # lib/aruba/cucumber.rb:215

Failing Scenarios:
cucumber features/flushing.feature:7 # Scenario: A little output
cucumber features/exit_statuses.feature:11 # Scenario: Not explicitly exiting at all
cucumber features/exit_statuses.feature:15 # Scenario: non-zero exit status
cucumber features/exit_statuses.feature:20 # Scenario: Successfully run something
cucumber features/exit_statuses.feature:23 # Scenario: Unsuccessfully run something
cucumber features/output.feature:78 # Scenario: Match passing exit status and exact output

53 scenarios (6 failed, 47 passed)
152 steps (6 failed, 1 skipped, 145 passed)
1m38.137s

aruba 0.3.2 fails features (stdout buffering issue?)

I'm getting a few failures like this one with the released version of the aruba 0.3.2 gem. The intend of the feature seems to be fulfilled, just not the order in which the results are shown. I'm not sure to what extend this is considered to be a problem.

This is using "ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]". Please let me know if you need more details.

  Scenario: Detect output from all processes                    # features/output.feature:142
    When I run "ruby -e 'puts \"hello world!\"'"                # lib/aruba/cucumber.rb:94
    And I run "ruby -e 'puts gets.chomp.reverse'" interactively # lib/aruba/cucumber.rb:102
    And I type "hello"                                          # lib/aruba/cucumber.rb:106
    Then the output should contain exactly:                     # lib/aruba/cucumber.rb:138
      """
      hello world!
      olleh

      """
      expected: "hello world!\nolleh\n"
           got: "olleh\nhello world!\n" (using ==)
      Diff:
      
      @@ -1,3 +1,3 @@
      -hello world!
       olleh
      +hello world!
       (RSpec::Expectations::ExpectationNotMetError)
      ./features/support/../../lib/aruba/cucumber.rb:139:in `/^the output should contain exactly:$/'
      features/output.feature:146:in `Then the output should contain exactly:'

Aruba run cannot find script file

Perhaps I do not understand the proper way to invoke run from Aruba but when I try do this in a feature:

@announce
. . .
And run "vendor/plugins/activewarehouse-etl/bin/etl config/etl/client_xml.ctl"

Then I see this:
sh: vendor/plugins/activewarehouse-etl/bin/etl: No such file or directory

Yet:
$ ll vendor/plugins/activewarehouse-etl/bin/etl
-rwxr-xr-x 1 byrnejb byrnejb 1211 May 14 09:11 vendor/plugins/activewarehouse-etl/bin/etl

Any ideas as to what I might be doing wrong?

Binary available in $PATH but gets `exec': Exec format error Errno::ENOEXEC

The following scenario passes...

Scenario: Run geddy-gen app my_app
    When I run "which geddy-gen"
    Then the output should contain "geddy-gen"

...but the following fails...

Scenario: Run geddy-gen app my_app
    When I run "geddy-gen app the_banana_stand"
    Then the output should contain "Created app the_banana_stand."

The error described is as follows...

expected: /Created\ app\ the_banana_stand\./, got: "/Users/ryancook/Developer/.rvm/gems/ruby-1.8.7-p248@geddy-gen_tests/gems/background_process-1.2/lib/background_process/background_process.rb:39:in `exec': Exec format error - /usr/local/bin/geddy-gen app the_banana_stand (Errno::ENOEXEC)

Any ideas? Something related to Node apps and background processes? Searching previous issues and the Google didn't yield much.

Thanks in advance for any help!

ChildProcess::TimeoutError and "I run ..."

I run into this error sporadically when using the "I run" step:

And I run "melon -d test.db add test_file test_file_2" # aruba-0.3.2/lib/aruba/cucumber.rb:94
  process still alive after 1 seconds (ChildProcess::TimeoutError)
  features/edges.feature:9:in `And I run "melon -d test.db add test_file test_file_2"'

As far as I can tell from a little source diving, it looks like there's a hard-coded limit to how long Aruba will wait for a child process to quit, after it sends the quit signal. Googling really isn't telling me anything. Am I correct in interpreting this as aruba telling me that my child processes won't die for some reason? And, is there anything I can do?

We should eliminate should

I'd like steps to be more definitive, and less redundant.
should can be eliminated, it is everywhere and AFAICT adds no value.
Having just worked on these it is annoying and I really don't see exactly what value it adds that important enough to mean it has to be everywhere.

Would be interested in hearing what one loses by remove should

Multi-line string steps for "I should see stderr/stdout" etc

Just working on the Spork code, updating the features to use Aruba. I one of the Sporks steps was "the error output should contain" with a multiline string. Currently Aruba doesn't have an equivalent:

Then the stderr should contain:
  """
  Loading Spork.prefork block...
  """

For completeness it'd be great to have all the steps (I should see, I should not see, I should see exactly, etc) available in total/stdout/stderr single and multi-line forms.

Add exactly versions of output from command steps.

Add the steps:

Then /^the output from "([^"]*)" should contain exactly:"$/
Then /^the output from "([^"]*)" should not contain exactly:$/

At the moment I'm finding that output is being carried over between scenarios. So the first passes and the second should pass too, but fails because it has the first scenarios output pre-pended.

Run commands in the background

Sometimes it's necessary to run a process in the background. This can be because we want to interact with it from a different process. Examples:

  • Sending data to the process via STDIN
  • Run another process that needs the background process to be running in order to work

We can reuse some code from Cucumber:

http://github.com/aslakhellesoy/cucumber/blob/master/features/step_definitions/cucumber_steps.rb#L35
http://github.com/aslakhellesoy/cucumber/blob/master/features/support/env.rb#L97

How to autoload a gem's lib with aruba?

Hi. My question does not relate to the aruba dev, but I cannot think of another place to write it down. I discovered this great lib while browsing the rspec-core doc at relishapp, and started to use it in a gem. So good so far!

However, I must explicitely require my lib files within each "Given a file name โ€ฆ with" steps (require File.expand_path(โ€ฆ)). I saw the rspec features do not do this, but did not found the way autoloading was achieved (nothing under features/support).

Thank you.

Outputting a lot of data causes process to time out

This can be reproduced by uncommenting the commented step in flushing.feature.

(When a process times out, the exit status is nil)

Mike, can you take a look at this? Not sure if this is an Aruba bug or a BackgroundProcess bug.

Verification step quoting/matching semantics

Yo.

While working on interactive support in Aruba, I was surprised a few times by the different ways different verification steps handle quoting and matching of input strings. So I think we should make them consistent.

I've worked on this some in my interactive branch so that all steps with the word "contain" in them do this exactly:

  1. Unescape
  2. Compare using the include matcher (or just == in the case of the contain exactly steps)

While steps with "match" do this:

  1. Convert to a regex with /#{match_string}/
  2. Compare using the =~ matcher

This has problems. The check file content helper doesn't follow the rules (yet), but the biggest problem is that "include" doesn't provide a diff, which is really super helpful, but I was so frustrated at the time that I gladly took consistent quoting over that. Now that I've cooled off though I'm not so sure.

Whatever is decided, I'll make the changes gladly; I just want to make sure everything is consistent.

0.3.2 is incompatible with Rspec 2.5 ?

I've just tried upgrading but I can't get 0.3.2 to install. I get an error from bundler:

Bundler could not find compatible versions for gem "rspec":
  In Gemfile:
    rspec-rails (= 2.5.0) depends on
      rspec (~> 2.5.0)

    aruba (= 0.3.2) depends on
      rspec (2.3.0)

I may well be my own bundler weakness. It seems odd because aruba seems to have a ~> dependency on Rspec 2.3 in its gemspec.

Ubuntu 10.10, Ruby 1.9.2 -- ERROR: Failed to build gem native extensions.

Hi

I freshly installed Ruby on Rails and cucumber on an Ubuntu 10.10 machine, following the instructions on http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you.

When I try to install aruba it says that it cannot find rake, but it's in the path. Couldn't find anything about this on google. Anyone knows what the fault is, am I missing something?

rvm install 1.9.2
[... ok ...]
rvm use 1.9.2
[... ok ...]
gem install rails
[... ok ...]
gem install cucumber-rails
[... ok ...]
gem install aruba

Fetching: ffi-1.0.7.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing aruba:
ERROR: Failed to build gem native extension.

    rake RUBYARCHDIR=/home/fredrikelinder/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib RUBYLIBDIR=/home/fredrikelinder/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/lib

/home/fredrikelinder/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:388:in bin_path': can't find gem rake ([">= 0"]) with executable rake (Gem::GemNotFoundException) from /home/fredrikelinder/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in

'

Gem files will remain installed in /home/fredrikelinder/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7 for inspection.
Results logged to /home/fredrikelinder/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.7/gen/gem_make.out

gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.5)
actionpack (3.0.5)
activemodel (3.0.5)
activerecord (3.0.5)
activeresource (3.0.5)
activesupport (3.0.5)
arel (2.0.9)
builder (2.1.2)
bundler (1.0.10)
cucumber (0.10.2)
cucumber-rails (0.4.0)
diff-lcs (1.1.2)
erubis (2.6.6)
gherkin (2.3.5)
i18n (0.5.0)
json (1.5.1)
mail (2.2.15)
mime-types (1.16)
nokogiri (1.4.4)
polyglot (0.3.1)
rack (1.2.2)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (3.0.5)
railties (3.0.5)
rake (0.8.7)
term-ansicolor (1.0.5)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.25)

which rake
/home/fredrikelinder/.rvm/gems/ruby-1.9.2-p180/bin/rake

I should see matching for regex in partial output

Hi, thanks for sharing this library. Very handy.

I'll really like the simplicity of the existing "I should see" steps but I didn't spot one that handled regular expressions so I added a couple in a topic branch of my fork.

http://github.com/robertwahler/aruba/commit/2dc8e0260e56dc0aa25f356f1bdeac9bdaf4612f

I also added an announce-stdout to complement the existing announce tags here:

http://github.com/robertwahler/aruba/commit/a151980645014478b3707689723d6a259a1893d2

Please consider including these minor additions in your library.

Thanks, much.
robert wahler

'I successfully run' passes but no content is returned and 'the exit status should be 0' step fails

This step fails under aruba 0.2.4, cucumber 0.9.3 on 1.9.2p0

Given /^I configured git sanely$/ do
  puts "This is the project folder: #{@active_project_folder}"
  ['user.name', 'user.email', 'github.user', 'github.token'].each do |k|
    puts k
    When "I successfully run \"git config --global --get #{k}\""
    Then "the stderr should contain \"\""
    Then "the stdout should contain \"\""
    Then "the output should contain \"\""
    And "the exit status should be 0"
  end
end

The puts output and stack trace are:

/usr/src/fog
This is the project folder: /usr/src/fog
user.name

RuntimeError: Exit status was 1. Output:

/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/aruba-0.2.4/lib/aruba/api.rb:157:in `run'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/aruba-0.2.4/lib/aruba/cucumber.rb:99:in `block in <top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/step_match.rb:26:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:138:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/rb_support/rb_world.rb:22:in `__cucumber_invoke'
/usr/src/fog/features/step_definitions/vcs_steps.rb:12:in `block (2 levels) in <top (required)>'
/usr/src/fog/features/step_definitions/vcs_steps.rb:10:in `each'
/usr/src/fog/features/step_definitions/vcs_steps.rb:10:in `block in <top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/step_match.rb:26:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_invocation.rb:63:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_invocation.rb:42:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:15:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:14:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:14:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:53:in `block (2 levels) in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:77:in `block (2 levels) in with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:93:in `before_and_after'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:76:in `block in with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:115:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:115:in `block (3 levels) in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:13:in `block in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:95:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:95:in `execute_around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:12:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:114:in `block (2 levels) in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:112:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:112:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:88:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:75:in `with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:51:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:106:in `with_visitor'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:45:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:51:in `block in visit_feature_element'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:35:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:34:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:34:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:29:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:17:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:17:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:28:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:43:in `run!'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/cli/main.rb:48:in `execute!'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/cli/main.rb:21:in `execute'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/bin/cucumber:8:in `<top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/bin/cucumber:19:in `load'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/bin/cucumber:19:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
/usr/src/fog/features/vcs/vcs.feature:9:in `When I configured git sanely'

The command runs fine from the bash shell

$ git config --global --get user.name; echo $?
Hedgehog
0

If I change to use the 'I run ...' step, the behavior is the same but with a different stack trace:

Given /^I configured git sanely$/ do
  puts "This is the project folder: #{@active_project_folder}"
  ['user.name', 'user.email', 'github.user', 'github.token'].each do |k|
    puts k
    When "I run \"git config --global --get #{k}\""
    Then "the stderr should contain \"\""
    Then "the stdout should contain \"\""
    Then "the output should contain \"\""
    And "the exit status should be 0"
  end
end

The output is:

This is the project folder: /usr/src/fog
user.name

RSpec::Expectations::ExpectationNotMetError: expected: 0,
     got: 1 (using ==)
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/rspec-expectations-2.0.1/lib/rspec/expectations/fail_with.rb:29:in `fail_with'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/rspec-expectations-2.0.1/lib/rspec/matchers/operator_matcher.rb:39:in `fail_with_message'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/rspec-expectations-2.0.1/lib/rspec/matchers/operator_matcher.rb:61:in `__delegate_operator'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/rspec-expectations-2.0.1/lib/rspec/matchers/operator_matcher.rb:51:in `eval_match'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/rspec-expectations-2.0.1/lib/rspec/matchers/operator_matcher.rb:29:in `block in use_custom_matcher_or_delegate'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/aruba-0.2.4/lib/aruba/cucumber.rb:147:in `block in <top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/step_match.rb:26:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:138:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/rb_support/rb_world.rb:22:in `__cucumber_invoke'
/usr/src/fog/features/step_definitions/vcs_steps.rb:16:in `block (2 levels) in <top (required)>'
/usr/src/fog/features/step_definitions/vcs_steps.rb:10:in `each'
/usr/src/fog/features/step_definitions/vcs_steps.rb:10:in `block in <top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/step_match.rb:26:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_invocation.rb:63:in `invoke'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_invocation.rb:42:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:15:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:14:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/step_collection.rb:14:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:53:in `block (2 levels) in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:77:in `block (2 levels) in with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:93:in `before_and_after'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:76:in `block in with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:115:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:115:in `block (3 levels) in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:13:in `block in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:95:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:95:in `execute_around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/language_support/language_methods.rb:12:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:114:in `block (2 levels) in around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:112:in `call'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime/support_code.rb:112:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:88:in `around'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:75:in `with_hooks'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:51:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:106:in `with_visitor'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/scenario.rb:45:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:51:in `block in visit_feature_element'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:35:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:34:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/feature.rb:34:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:29:in `block in accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:17:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:17:in `each'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/features.rb:28:in `accept'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/runtime.rb:43:in `run!'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/cli/main.rb:48:in `execute!'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/lib/cucumber/cli/main.rb:21:in `execute'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/gems/cucumber-0.9.3/bin/cucumber:8:in `<top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/bin/cucumber:19:in `load'
/home/hedge/.rvm/gems/ruby-1.9.2-p0@fog/bin/cucumber:19:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
/usr/src/fog/features/vcs/vcs.feature:9:in `When I configured git sanely'

No 'Then the output should contain ...'?

Had trouble with

Then the output should contain "..."

It said the step definition did not exist. I changed to stdout, instead of output, and it worked fine though. Perhaps output is not part of the latest gem release yet, but just in case I thought I'd let you know.

Add run_script_string(:engine=> 'ruby', :cmd => string)

Currently, you have to create a file, say script_file, then run chmod +x script_file, then call run_simple("./script_file")
Instead it would be useful to simply do:

cmd =<<-END_CMD.gsub(/^ {4}/, '')
  #!/usr/bin/env bash
  rvm gemset use vagrant
  cd #{vagrant.path}
  echo vagrant up #{vm_name}
  END_CMD
run_script_string(cmd)
stdout_from(cmd).should_not include(name)

of course the hash-bang could ruby etc.

In case it helps work out where any changes are required, the error you currently get:

    /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/childprocess-0.1.8/lib/childprocess/unix/process.rb:92:in `exec': No such file or directory - #!/usr/bin/env (Errno::ENOENT)
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/childprocess-0.1.8/lib/childprocess/unix/process.rb:92:in `block in launch_process'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/childprocess-0.1.8/lib/childprocess/unix/process.rb:83:in `fork'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/childprocess-0.1.8/lib/childprocess/unix/process.rb:83:in `launch_process'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/childprocess-0.1.8/lib/childprocess/abstract_process.rb:52:in `start'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/aruba-0.3.6/lib/aruba/process.rb:22:in `run!'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/aruba-0.3.6/lib/aruba/api.rb:212:in `block in run'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/aruba-0.3.6/lib/aruba/api.rb:9:in `chdir'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/aruba-0.3.6/lib/aruba/api.rb:9:in `in_current_dir'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/aruba-0.3.6/lib/aruba/api.rb:206:in `run'
from /home/hedge/.rvm/gems/ruby-1.9.2-p180@bbb_vm_monitor/gems/aruba-0.3.6/lib/aruba/api.rb:231:in `run_simple'

Awkward path when running files in bin/

If I'm working on a gem with an included executable in bin/, e.g.

> ls
bin/todo
lib/todo.rb
features/new_todo.feature
# etc.

I can't use a step like

Given I successfully run `bin/todo new 'My New TODO'`

instead, I have to

Given I successfully run `../../bin/todo new 'My New TODO'`

I know I could set @dirs to be ['.'], but I like the idea of the cwd being a tmp directory. The only way around this is to make my own custom step that calls the internal one, unless I'm missing something. I can think of two ways around this:

  • Provide some sort of "executable name"-to-"actual path" mapping that can be configured, e.g. @exec_map['todo'] = '../../bin/todo' }
  • Provide a way to modify the PATH environment variable during runtime

Is either of these preferred, or is there some other way to deal with this issue (or is it just me?)

Aruba doesn't work on JRuby :(

Inspired by RSpec's awesome cukes, I've started working on rewriting the cukes for my VCR gem in a similar style, using aruba. Unfortunately, I discovered that the latest Aruba is not compatible with JRuby. Here's the output when you run aruba's cukes on JRuby:

no library specified (LoadError)
/Users/mmarston/.rvm/rubies/jruby-1.5.2/lib/ruby/site_ruby/shared/ffi/library.rb:46:in `ffi_libraries'
/Users/mmarston/.rvm/rubies/jruby-1.5.2/lib/ruby/site_ruby/shared/ffi/library.rb:96:in `attach_function'
/Users/mmarston/.rvm/rubies/jruby-1.5.2/lib/ruby/site_ruby/shared/pty.rb:11
/Users/mmarston/.rvm/rubies/jruby-1.5.2/lib/ruby/site_ruby/shared/pty.rb:1:in `require'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/background_process-1.2/lib/background_process/pty_background_process.rb:1
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/background_process-1.2/lib/background_process/pty_background_process.rb:2:in `require'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/background_process-1.2/lib/background_process.rb:2
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/background_process-1.2/lib/background_process.rb:3:in `require'
/Users/mmarston/code/aruba/features/support/../../lib/aruba/api.rb:3
/Users/mmarston/code/aruba/features/support/../../lib/aruba/api.rb:1:in `require'
/Users/mmarston/code/aruba/features/support/../../lib/aruba/cucumber.rb:1
/Users/mmarston/code/aruba/features/support/../../lib/aruba/cucumber.rb:1:in `require'
/Users/mmarston/code/aruba/features/support/../../lib/aruba.rb:1
/Users/mmarston/code/aruba/features/support/../../lib/aruba.rb:2:in `require'
/Users/mmarston/code/aruba/features/support/env.rb:2
/Users/mmarston/code/aruba/features/support/env.rb:143:in `load'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:176:in `load_file'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:78:in `load_files!'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:77:in `each'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime/support_code.rb:77:in `load_files!'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:137:in `load_step_definitions'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/runtime.rb:39:in `run!'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/cli/main.rb:48:in `execute!'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/../lib/cucumber/cli/main.rb:21:in `execute'
/Users/mmarston/.rvm/gems/jruby-1.5.2/gems/cucumber-0.9.4/bin/cucumber:8
rake aborted!
Command failed with status (1): [bundle exec /Users/mmarston/.rvm/rubies/jr...]

I don't think background_process is compatible with JRuby at all. Is aruba intended to be compatible with JRuby?

Escaping in multiline strings breaks compatibility and is not necessarily desired

I have steps which look like this:

Then the output should contain:
     """
     REPLACE INTO some_table (some,columns,here) VALUES ("hello","world",42);
     """

(but with slightly longer SQL which doesn't easily fit on one line). v0.2.7, or at least commit 2f6b109, added unescaping of the string in this step (and others), which gives me errors like this:

   (eval):2: syntax error, unexpected tINTEGER, expecting $end
  ("hello","world",...
            ^ (SyntaxError)

In my opinion it's not desirable to unescape multiline strings. My interpretation of strings in a feature is that they show what is expected, verbatim. Having to escape quotes in a string that uses another kind of quoting (the triple quotes in this case), doesn't make sense.

It's also bad that this API breaking change was introduced in a patch-level version, but I've ranted about that in another issue.

Duplicate step name if using Aruba in a Rails app

The step 'Then I should see "whatever"' is duplicated in web_steps.rb (provided when using cucumber-rails). My thought is to remove the step (allowing only for multiline) or change the text to be more clear that it's related to the command line; thoughts?

Broken pipe (Errno::EPIPE) on "I type" step

I'm testing a rubygem I've built using visionmedia/commander, I get this message

Error Message:
And I type "32h23d9823dj9832d89" # aruba-0.2.3/lib/aruba/cucumber.rb:102
Broken pipe (Errno::EPIPE)
features/create.feature:11:in `And I type "32h23d9823dj9832d89"'

Handle ANSI color codes in strings

Maybe the exact steps ought not strip out ANSI code, but the contain steps ought to remove ANSI color codes:

str.gsub(/\e\[(\d+)m/, '')

At the moment I just add this to any step files where I need this...

module Aruba
  class Process
    def remove_ansi_codes(str)
      str.gsub(/\e\[(\d+)m/, '')
    end
    def stdout
      wait_for_io do
        @out.rewind
        remove_ansi_codes(@out.read)
      end
    end
    def stderr
      wait_for_io do
        @err.rewind
        remove_ansi_codes(@err.read)
      end
    end
  end
end

@last_exit_status for an interactive session

I just upgraded to 0.2.7 I can't tell for sure if this is still true in 0.3.2 because I can't run it yet, but I think so from reading the code.

I need to check the exit status from an interactive session. In an earlier iteration of the interactive stuff that I was previously using, I could do @interactive.status and check the status, but that's not offered on the new Process class. I did however notice that the status code is returned by Process#stop

So I wrote a step def:

When /^the console session ends$/ do
  @last_exit_status = @interactive.stop
end

Now I can use the @last_exit_status like you would for a non-interactive session.

I don't know if there's a better way of building this in, or whether that step should ship with aruba, but I thought I'd flag it up.

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.