Forum: RSpec Cucumber autotest load error between 0.1.8 and 0.1.9

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5ea998105e1c31838a791c34ab5681e3?d=identicon&s=25 Harry Love (Guest)
on 2008-11-18 04:26
(Received via mailing list)
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
D069ac0170dc6c93bad77734258fadae?d=identicon&s=25 Peter Jaros (Guest)
on 2008-11-18 15:57
(Received via mailing list)
On Mon, Nov 17, 2008 at 10:19 PM, Harry Love <harry@harrylove.org>
wrote:

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

Also, does `script/cucumber features` work?

Peter
5ea998105e1c31838a791c34ab5681e3?d=identicon&s=25 Harry Love (Guest)
on 2008-11-18 16:38
(Received via mailing list)
On Tue, Nov 18, 2008 at 7:56 AM, Peter Jaros <peter.a.jaros@gmail.com>
wrote:
> Could you explain what doesn't work when you run autotest?  Or, I
> suppose, what it *does* do? :)
>
> 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
This topic is locked and can not be replied to.