On Wed, Feb 18, 2009 at 6:48 AM, Antoine Toulme <anto...@lunar-ocean.com>wrote:
> Howdy guys, > > we are developing Buildr4eclipse and we made the switch to Cucumber to run > our tests. We have a hard time interfacing with Buildr. > > What we did so far: > 1. We used braid, as Assaf had recommended, to hook ourselves against a > working copy of Buildr. > 2. We require the spec/spec_helpers.rb file so we have access to Buildr > internals. > > We run our test suite with this assertion: > define('foo').compile.compiler.should eql(:pdec) > > Which fails with this error: > undefined method `from' for <Rake::Task compile => []>:Rake::Task > (NoMethodError) > > > /Users/antoine/perso/buildr4eclipse/buildr/lib/buildr/core/compile.rb:533:in > `compile' > > This happens because the before_define hook defined in the Compile module > is > not executed. The Compile module is present on the Buildr::Project class > though. > > Does this ring a bell ? Note that we reproduce the problem even after > uninstalling all Buildr gems from our system. All the Buildr specs are written to use the define method introduced by spec/spec_helper.rb, which defines a project and immediately evaluates it, so you can write something like define('foo').result.should expected. I'm going to suspect that your code is calling the real define method. Assaf > > > Thanks, > > Antoine >