[rspec-users] Problems running features with Textmate Cucumber bundle

Ben Mabey
2009-04-27T15:20:37Z

Rick DeNatale wrote:
> On Mon, Apr 27, 2009 at 10:07 AM, aslak hellesoy
> <aslak.hellesoy at gmail.com> wrote:
>
>> On Mon, Apr 27, 2009 at 3:47 PM, Rick DeNatale <rick.denatale at
gmail.com>
>> wrote:
>>
>>> On Mon, Apr 27, 2009 at 8:13 AM, Rick DeNatale <rick.denatale at
gmail.com>
>>> wrote:
>>>
>>>> On Sun, Apr 26, 2009 at 11:38 PM, Ben Mabey <ben at
benmabey.com> wrote:
>>>>
>>>>> Rick DeNatale wrote:
>>>>>
>>>>>> I finally plunked down for the beta RSpec bundle and
I''m working
>>>>>> through the initial example.  Although I''m a
fairly experienced RSpec
>>>>>> user, I''m stlll learning new tricks.
>>>>>>
>>>>>> Anyway,  I''m going though the mastermind
example, and everything is
>>>>>> going well, except that I decided to also try out the
Textmate bundle
>>>>>> for Cucumber.  I decided to use Ben Mabey''s
fork on github since it
>>>>>> seems to be the most evolved.
>>>>>>
>>>>>> When I try to run a feature with cmd-R, instead of
actually running I
>>>>>> see something like:
>>>>>>
>>>>>> Running: cucumber
>>>>>>
/Users/rick/mastermind/features/codebreaker_starts_game.feature
>>>>>> --format=html
>>>>>> false
>>>>>>
>>>>>> Cucumber runs fine from bash.
>>>>>>
>>>>>> Am I missing some setup?
>>>>>>
>>>>>>
>>>>>>
>>>>> Hmm.. that is odd. What version of Cucumber are you using?
When you
>>>>> run
>>>>> that exact command from the shell does it output the HTML
report?
>>>>>
>>>> I was runing 0.3.0 upgrading to 0.3.1 has the same result BUT
>>>>
>>>> If I run that exact command
>>>>
>>>> $
/Users/rick/mastermind/features/codebreaker_starts_game.feature
>>>> --format=html
>>>> -bash:
/Users/rick/mastermind/features/codebreaker_starts_game.feature:
>>>> Permission denied
>>>>
>>>>
>>>> It''s trying to run the feature as an executable
directly it''s not
>>>> running the cucumber executable!
>>>>
>>>> Why it be doin dat?
>>>>
>>> Actually, I was misreading the output in the run window, which was
>>> wrapping.
>>>
>>> $  cucumber
>>> /Users/rick/mastermind/features/codebreaker_starts_game.feature
>>> --format=html false
>>>
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/step_mother.rb:125:in
>>> `Given'': Multiple step definitions have the same Regexp:
>>> (Cucumber::Redundant)
>>>
>>> features/step_definitions/mastermind.rb:13:in `/^I am not yet
playing$/''
>>> features/step_definitions/mastermind.rb:13:in `/^I am not yet
playing$/''
>>>
>>>        from
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/step_mother.rb:124:in
>>> `each''
>>>        from
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/step_mother.rb:124:in
>>> `Given''
>>>        from ./features/step_definitions/mastermind.rb:13
>>>        from
>>> /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
>>> `gem_original_require''
>>>        from
>>> /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
>>> `polyglot_original_require''
>>>        from
>>>
/opt/local/lib/ruby/gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in
>>> `require''
>>>        from
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/cli/main.rb:79:in
>>> `require_files''
>>>        from
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/cli/main.rb:77:in
>>> `each''
>>>        from
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/cli/main.rb:77:in
>>> `require_files''
>>>        from
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/cli/main.rb:34:in
>>> `execute!''
>>>        from
>>>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/cli/main.rb:20:in
>>> `execute''
>>>        from
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/cucumber:6
>>>        from /opt/local/bin/cucumber:19:in `load''
>>>        from /opt/local/bin/cucumber:19
>>>
>>> If I do this from the project directory:
>>>
>>>  $ cucumber features/codebreaker_starts_game.feature
>>> Feature: Codebreaker starts game
>>>  As a Codebreaker
>>>  I want to start a game
>>>  So that I can break the code
>>>
>>>  Scenario: Start game                                #
>>> features/codebreaker_starts_game.feature:5
>>>    Given I am not yet playing                        #
>>> features/step_definitions/mastermind.rb:13
>>>    When I start a new game                           #
>>> features/step_definitions/mastermind.rb:24
>>>    Then the game should say "Welcome to Mastermind!" #
>>> features/step_definitions/mastermind.rb:28
>>>    And the game should say "Enter guess:"            #
>>> features/step_definitions/mastermind.rb:28
>>>
>>> 1 scenario
>>> 4 passed steps
>>>
>>>
>>> Running under textmate, cucumber seems to be somehow convincing
itself
>>> that
>>> features/step_definitions/mastermind.rb:13:in `/^I am not yet
playing$/''
>>>
>>> Duplicates itself?!?
>>>
>> What''s happening is that the file containing step defs is
being loaded
>> twice, and therefore you get dupe step defs. Not sure why
that''s happening
>> though...
>>
>
> Yes, I figured it was somehing like that. On a little more trial and
> error, it appears that the bundle is adding false to the end of the
> command string which is causing that steps def to be required
> initially:
>
> $ cucumber /Users/rick/mastermind/features/codebreaker_starts_game.feature
> --format=html false -v
> Ruby files required:
>   * /Users/rick/mastermind/features/support/env.rb
>   * ./features/support/env.rb
>   * ./lib/mastermind/game.rb
>   * /Users/rick/mastermind/features/step_definitions/mastermind.rb
>
/Users/rick/.gem/ruby/1.8/gems/cucumber-0.3.1/bin/../lib/cucumber/step_mother.rb:125:in
> `Given'': Multiple step definitions have the same Regexp:
> (Cucumber::Redundant)
>
> features/step_definitions/mastermind.rb:13:in `/^I am not yet
playing$/''
> features/step_definitions/mastermind.rb:13:in `/^I am not yet
playing$/''
>
> Haven''t yet figured out where that false is coming from, somewhere
in
> runner.rb in the bundle
>
>
>
>
I don''t think the ''false'' is part of the command.
That is the exit code
of the cucumber I think (well, the boolean representation of it).  I''ll
take a look at it though.

-Ben