You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by "Assaf Arkin (JIRA)" <ji...@apache.org> on 2008/01/27 01:00:34 UTC

[jira] Commented: (BUILDR-29) Run RSpec specs with JRuby

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

Assaf Arkin commented on BUILDR-29:
-----------------------------------

Thanks.

Few comments form looking at the source code, I didn't merge it yet:

*  defined?(JRUBY) will fail on constant not found.  I always trip on that one.  Should be defined?('RUBY').

*  I'm wondering that the location default should be:
- spec -- Same one you would use if this was a Ruby project
- src/test/spec -- Consistent with src/test/java, src/test/scala, etc
- src/test/rspec -- To avoid conflict with something else that might be called spec

*  Project should be public on task.  I'll add that.

*  The code to locate and install the RSpec Gem worries me, it looks fragile.  I think a better trick would be to require a Ruby file provided by Buildr, which will just run ahead of RSpec, requiring/installing the Gem.

*  jruby_home should not depend on project ... it won't work when tests are run on a sub-project.  But it can depend on the current directory being the same as the buildfile.


> Run RSpec specs with JRuby
> --------------------------
>
>                 Key: BUILDR-29
>                 URL: https://issues.apache.org/jira/browse/BUILDR-29
>             Project: Buildr
>          Issue Type: New Feature
>          Components: Test frameworks
>    Affects Versions: 1.3
>            Reporter: Nick Sieger
>         Attachments: buildr_framework.rb
>
>
> Attached is a test framework I wrote that allows me to write RSpec specs that test Java code.
> If Buildr is run under MRI, JRuby is downloaded as a dependency and launched to run the specs.
> If Buildr is run under JRuby, JRuby will launch a sub-vm of itself, including the project classpath but using the same JRuby version that was used to launch Buildr.
> Note the following features and/or limitations:
> * No specs for this currently exist; they'll need to be written if you want the coverage. I probably won't write them (for now) :)
> * Assumes project specs are in the "spec" directory. You may want this to be customized.
> * Runs specs in "specdoc" mode (hard-coded). Choosing a formatter would be another possible customization.
> * Allows a {{SPEC}} environment variable to be set or passed on the command-line to specifiy a single spec to run (just like the RSpec rake task)
> * Allows {{:required_gems}} as an option to be passed to the "test" clause of the project, which will ensure that gems are present before running (installing them if necessary) before running specs. There is currently no way to specify gem version.
> * Uses ci_reporter to generate JUnit-like XML reports; assumes that they may be useful (perhaps in conjunction with the junit:report task); but it's not strictly necessary.

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