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

Ben Mabey
2009-04-27T19:00:39Z

Ben Mabey wrote:
> Rick DeNatale wrote:
>> On Mon, Apr 27, 2009 at 11:42 AM, Ben Mabey <ben at benmabey.com>
wrote:
>>
>>> Do you happen to be explicitly requiring any of your step
>>> definitions from
>>> your env.rb or other files?  What does your env.rb look like?
>>>
>>>
>>
>> Yes, env.rb is right out of the RSpec book B4.0
''printing'' p 43
>>
>> $: << File.join(File.dirname(__FILE__), "/../../lib" )
>> require ''spec/expectations''
>> require ''mastermind''
>>
>> You are right that the false is being output by running the command,
>> not the command line.  I hacked the runner.rb file in the bundle to
>> insert a <br\> between outputting and running the command.
>>
>> The mystery is why the same command running in Textmate reloads the
>> spec definition, but not when invoked by bash?  And when I add false
>> to the end of the command in bash it does.
>>
>> Having just typed that I realize that I wasn''t really sure
that the
>> reload WAS the problem running under textmate. So I hacked the run
>> method in runner.rb in the bundle to show stderr as well as stdout:
>>
>>         in_project_dir do
>>           @output << %Q{Running: #{full_command = "bash
\"2>&1
>> #{command} #{@file.rake_task} #{argv.join(''
'')}\""} \n}
>>           @output << "<br\>"
>>           @output << Kernel.system(full_command)
>>         end
>>
>> And this outputs:
>>
>> Running: bash "2>&1 cucumber
>> /Users/rick/mastermind/features/codebreaker_starts_game.feature
>> --format=html"
>> bash: 2>&1 cucumber
>> /Users/rick/mastermind/features/codebreaker_starts_game.feature
>> --format=html: No such file or directory false
>>
>> I''m guessing that the file it isn''t finding is
cucumber?  Is there an
>> environment variable I need to set in textmate?
>>
>>
>>
>>
>
> Ahh, I''ve had similar issues with RSpec''s bundle before.
Basically,
> your PATH is not being used for all of your OSX applications. From the
> rspec site[1]:
>
> You may need to adjust the PATH in your ~/.MacOSX/environment.plist
> file to point to the directory
> where your ruby and spec executables live. For example:
>
> <key>PATH</key>
>
<string>/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/usr/local/mysql/bin</string>
>
>
>
>
> I will also add a TM_CUCUMBER_BIN constant option so if that is set it
> will use that instead of assuming ''cucumber'' is in your
path.  I''ll
> let you know when that is done.
http://github.com/bmabey/cucumber-tmbundle/commit/8516e1c40cf6181e35d45db943de374d7516fcc1

Try updating the bundle and defining a TM_CUCUMBER_BIN in Textmate
(Textmate -> Preferences -> Advanced -> Shell Variables).

Let me know how it goes.

Thanks,
Ben