On Tue, May 31, 2011 at 10:43 AM, Dan King <[email protected]> wrote:

> Anyone know if it is possible to use RSpec with Buildr via JRuby to test
> Groovy
> code? If yes, how? Thanks.
>

Just require 'buildr/groovy', put your groovy files under src/main/groovy
and your rspec files under src/test/spec and Buildr should automatically do
the right thing, e.g.,

$ tree
.
|-- buildfile
|-- src
|   |-- main
|   |   `-- groovy
|   |       `-- Foo.groovy
|   `-- spec
|       `-- ruby
|           `-- foo_spec.rb

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.

alex

Reply via email to