buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <alex.boisv...@gmail.com>
Subject Re: Possible to Test Groovy Code with RSpec/JRuby?
Date Wed, 01 Jun 2011 01:42:16 GMT
On Tue, May 31, 2011 at 5:28 PM, Dan King <dan.king106@yahoo.com> wrote:

> > Just require 'buildr/groovy', put your groovy files under
>  src/main/groovy
>
> Do you know why buildr pulls in groovy 1.7.5 even though I set the
> buildfile to
> pull version 1.8.0 via:
>
> GROOVY = transitive('org.codehaus.groovy:groovy:jar:1.8.0')
> compile.with GROOVY
>

You have to override the plugin's default version; otherwise you're just
adding yet-another-version of Groovy on the classpath (a sure recipe for
failure!).  Instead, add the following near the top of your buildfile:

Buildr::Groovy::Groovyc::REQUIRES.groovy.version = '1.8.0'

> and your rspec files under src/test/spec
>
> Did you mean src/spec?
>

Yes, sorry.


> > One word of caution, though, the integration is fragile  because JRuby
> and
> > RSpec have been moving targets and I don't think many  people have been
> using
> > RSpec to test Java/Groovy stuff.   The code is  good but it's heavily
> > dependent on the environment configuration being right  -- I believe the
> > magic combination is JRuby v1.5.6, RSpec 2.1.0, with the  jruby 0.1 gem
> > installed.
>
> Thanks for the warning; so far it 'works,' but should it start to get
> troublesome, I'll probably switch over to easyb.
>

Unfortunately, I wouldn't qualify the easyb integration as easier to work
with... if you get into trouble, I'd rather fix the rspec integration
(assuming that's your preferred option).

good luck,
alex

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message