Skip to content

Instantly share code, notes, and snippets.

@akiellor
Created August 19, 2011 01:50
Show Gist options
  • Save akiellor/1155811 to your computer and use it in GitHub Desktop.
Save akiellor/1155811 to your computer and use it in GitHub Desktop.
Gradle which supports rspec :-)
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
import org.rubygems.repository.GemResolver;
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.jruby', name: 'jruby-complete', version: '1.6.3'
}
}
configurations { gem }
dependencies {
gem name: "rspec", version: "2.6.0"
}
repositories {
mavenCentral()
add(new GemResolver(buildscript.configurations.classpath.asPath, file(".gems")));
}
task(spec, dependsOn: ["classes", "testClasses"], type: JavaExec) {
configurations.gem.asPath
main = 'org.jruby.Main'
classpath = sourceSets.test.runtimeClasspath + buildscript.configurations.classpath
args = ['-S', 'rspec', 'src/spec/ruby']
println file(".gems").path
environment['GEM_HOME'] = file(".gems").path
environment['GEM_PATH'] = file(".gems").path
environment['PATH'] = file(".gems/bin").path + ":" + environment['PATH']
}
require 'java'
require 'rspec'
describe "a stack" do
subject { java.util.Stack.new }
it { should be_empty }
end
@judoole
Copy link

judoole commented May 29, 2014

Q: Where does the import org.rubygems.repository.GemResolver reside?
Can't seem to resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment