On Wed, Feb 18, 2009 at 6:02 PM, Assaf Arkin <ar...@intalio.com> wrote:
> 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. > That must be it. Placing a debugger call inside that method shows it isn't called when we call define. I am wondering, are we missing the equivalent of this ? (at the end of spec_helpers.rb) Spec::Runner.configure do |config| # Make all Buildr methods accessible from test cases, and add various helper methods. config.include Buildr, SpecHelpers # Sanbdox Buildr for each test. config.include Sandbox end > > Assaf > > >> >> >> Thanks, >> >> Antoine >> > >