About RSpec Plug-in

RSpec Plug-in is a Maven plug-in for JRuby and RSpec .

It allows you to execute your JRuby RSpec tests as part of your build.

How To Use

You need to configure your projects pom.xml correctly:

  • include your *.rb files as resources
  • register where your JRuby installation is located
  • specify where your RSpec files are located
  • define where you would like the RSpec report file to be written to

Refer to the following pom.xml as an example:

<project>
  <build>
    <!-- Make sure your Ruby files are included -->
    <resources>
      <resource>
        <directory>src/main/ruby</directory>
        <includes>
          <include>**/*.rb</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rspec-maven-plugin</artifactId>
        <configuration>
          <!-- jrubyHome points to the JRuby installation you wish to use (usually ${env.JRUBY_HOME}) -->
          <jrubyHome>${env.JRUBY_HOME}</jrubyHome>
          <!-- sourceDirectory references where your RSpec tests reside -->
          <sourceDirectory>${basedir}/src/test/specs</sourceDirectory>
          <!-- outputDirectory specifies where the RSpec report should be placed -->
          <outputDirectory>${basedir}/target</outputDirectory>
        </configuration>
        <executions>
          <execution>
            <id>test</id>
            <phase>test</phase>
            <goals>
              <goal>spec</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Getting plug-in

Stable releases are available via the Mojo repository mojo repository .

Snapshot releases are available via the Mojo snapshots repository mojo snapshot repository .