Cucumber autotest load error between 0.1.8 and 0.1.9

Hi,

I’m new to the list and to Cucumber (and RSpec and testing in general)
so I apologize if this has already come up. I searched the archive and
didn’t see anything.

Last week I installed Cucumber 0.1.8 for my Rails app and both
‘cucumber features’ and ‘rake features’ worked fine. Features and
steps were evaluated.

Today I upgraded Cucumber to 0.1.9 and tried to set up autotest. It
didn’t work.

Long story short, I installed the gems but didn’t put them in my
vendor/plugins directory (by choice). In 0.1.8, script/cucumber was
only looking in vendor/plugins. In 0.1.9, there’s a LoadError
exception rescue that defaults to the local gem if it can’t be found
in vendor/plugins.

0.1.8
#!/usr/bin/env ruby
load File.expand_path(File.dirname(FILE) +
“/…/vendor/plugins/cucumber/bin/cucumber”)

0.1.9
#!/usr/bin/env ruby
begin
load File.expand_path(File.dirname(FILE) +
“/…/vendor/plugins/cucumber/bin/cucumber”)
rescue LoadError
require “rubygems”
load File.join(Gem.bindir, “cucumber”)

I hope that helps somebody else.

Cheers,
Harry

On Mon, Nov 17, 2008 at 10:19 PM, Harry L. [email protected]
wrote:

in vendor/plugins.
Could you explain what doesn’t work when you run autotest? Or, I
suppose, what it does do? :slight_smile:

Also, does script/cucumber features work?

Peter

On Tue, Nov 18, 2008 at 7:56 AM, Peter J. [email protected]
wrote:

Could you explain what doesn’t work when you run autotest? Or, I
suppose, what it does do? :slight_smile:

Also, does script/cucumber features work?

I originally ran ‘script/generate cucumber’ under 0.1.8. The
script/cucumber executable created by that process looks in
vendor/plugins for the gem and doesn’t include the rescue from
LoadError if it’s not found.

Yesterday I upgraded to 0.1.9. I was not aware that I needed to re-run
‘script/generate cucumber’ again for my app. Doing so solved the
problem because it updated the script/cucumber executable which now
includes the rescue clause.

‘script/cucumber features’ works now, as does autotest. Before the
update I was running ‘rake features’ and ‘cucumber features’ manually,
both of which point to the gem, so I never received an error.

I only noticed the problem when I tried to use autotest because it
calls script/cucumber which, until I regenerated the cucumber code,
only looked in vendor/plugins for the gem. So a LoadError exception
was being thrown.

Harry