[ 
https://issues.apache.org/jira/browse/BUILDR-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674436#action_12674436
 ] 

Rhett Sutphin commented on BUILDR-254:
--------------------------------------

In order to address both this issue and BUILDR-252 on buildr 1.3.3, I wrote the 
below monkey patch.  It's probably not a good general solution -- it would be 
better not to introduce the dependency on facets/dictionary into buildr itself 
and it would be nicer if buildr allowed for the rspec version to be configured 
like the jruby version (among other things).  As a monkey patch, though, it has 
the benefit of being minimally intrusive and functional.

It illustrates one problem with the explicit deps solution in the last comment 
-- the unordered nature of ruby hashes happens to put rspec first when the gems 
hash is iterated over (i.e., before hoe and cucumber) -- so the hash needs to 
be replaced with something ordered.

require 'facets/dictionary'
require 'buildr/java/bdd'

class Buildr::RSpec < TestFramework::JavaBDD
  def runner_config
    runner = super
    # use facets' Dictionary to preserve insertion order so that the deps
    # get installed first
    runner.gems = Dictionary.new.merge runner.gems
    
    # explicitly include rspec deps for auto-install
    runner.gems.update 'hoe' => '>0'
    runner.gems.update 'cucumber' => '>=0.1.13'

    runner.gems.update 'rspec' => '=1.1.12'
    runner.requires.unshift 'spec'
    runner
  end
end

> Automatically installing rspec-1.1.12 under JRuby 1.1.3 does not install all 
> dependencies
> -----------------------------------------------------------------------------------------
>
>                 Key: BUILDR-254
>                 URL: https://issues.apache.org/jira/browse/BUILDR-254
>             Project: Buildr
>          Issue Type: Bug
>          Components: JRuby, Test frameworks
>    Affects Versions: 1.3.4
>         Environment: buildr trunk @745153
> OS X standard ruby 1.8.6 (to run buildr)
> JRuby 1.1.3 (as installed automatically by buildr)
>            Reporter: Rhett Sutphin
>
> 1.3.4 updates the rspec dependency to rspec-1.1.12.  Unfortunately, under the 
> version of rubygems included with the default version of jruby (1.1.3), "gem 
> install rspec" does not pull in all its runtime dependencies.  
> See the comments on BUILDR-252 for more information.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to