Skip to content

Commit

Permalink
switched to rspec-3 and added .rspec with --require spec_helper
Browse files Browse the repository at this point in the history
Sponsored by Lookout Inc.
  • Loading branch information
mkristian committed Jun 23, 2015
1 parent 8015992 commit 114a39e
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 27 deletions.
1 change: 1 addition & 0 deletions maven/jruby/src/it/runnable/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
2 changes: 1 addition & 1 deletion maven/jruby/src/it/runnable/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'rspec', '~> 2.14'
gem 'rspec', '~> 3.0'

gem 'rake', '~> 10.3'

Expand Down
27 changes: 18 additions & 9 deletions maven/jruby/src/it/runnable/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,24 @@ GEM
maven-tools (1.0.7)
virtus (~> 1.0)
rake (10.3.2)
rspec (2.99.0)
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.2)
rspec (3.3.0)
rspec-core (~> 3.3.0)
rspec-expectations (~> 3.3.0)
rspec-mocks (~> 3.3.0)
rspec-core (3.3.1)
rspec-support (~> 3.3.0)
rspec-expectations (3.3.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-mocks (3.3.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
ruby-maven (3.1.1.0.8)
maven-tools (~> 1.0.1)
ruby-maven-libs (= 3.1.1)
ruby-maven-libs (3.1.1)
thread_safe (0.3.4)
thread_safe (0.3.4-java)
virtus (1.0.3)
axiom-types (~> 0.1)
Expand All @@ -47,4 +53,7 @@ PLATFORMS
DEPENDENCIES
jbundler (= 0.7.1)
rake (~> 10.3)
rspec (~> 2.14)
rspec (~> 3.0)

BUNDLED WITH
1.10.4
7 changes: 6 additions & 1 deletion maven/jruby/src/it/runnable/Mavenfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build do
directory 'pkg'
end

files = [ 'config.ru', '*file', '*file.lock', '.jbundler/classpath.rb',
files = [ '.rspec', 'config.ru', '*file', '*file.lock', '.jbundler/classpath.rb',
'lib/**', 'app/**', 'config/**', 'vendor/**', 'spec/**' ]
jruby_plugin!( :gem,
# need a jruby-complete from maven central here
Expand All @@ -27,6 +27,11 @@ jruby_plugin!( :gem,
execute_goals( 'generate-resources', 'process-resources', :includeBinStubs => true, :includeRubyResources => files )
end

plugin :jar, '2.4', :outputDirectory => '.', :finalName => 'runnable' do
execute_goal :jar, :phase => :'prepare-package'
end
plugin :clean, '2.4', :filesets => [ { :directory => '.', :includes => ['runnable.jar', '*/**/*.jar'] } ]

if File.file?('Jarfile.lock')
phase 'generate-resources' do
plugin :dependency do
Expand Down
22 changes: 12 additions & 10 deletions maven/jruby/src/it/runnable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<configuration>
<includeBinStubs>true</includeBinStubs>
<includeRubyResources>
<includeRubyResource>.rspec</includeRubyResource>
<includeRubyResource>config.ru</includeRubyResource>
<includeRubyResource>*file</includeRubyResource>
<includeRubyResource>*file.lock</includeRubyResource>
Expand Down Expand Up @@ -202,7 +203,7 @@
</configuration>
</execution>
<execution>
<id>rspec</id>
<id>rake spec</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
Expand All @@ -212,12 +213,13 @@
<argument>-jar</argument>
<argument>runnable.jar</argument>
<argument>-S</argument>
<argument>rspec</argument>
<argument>rake</argument>
<argument>spec</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>rake spec</id>
<id>rspec</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
Expand All @@ -227,8 +229,7 @@
<argument>-jar</argument>
<argument>runnable.jar</argument>
<argument>-S</argument>
<argument>rake</argument>
<argument>spec</argument>
<argument>rspec</argument>
</arguments>
</configuration>
</execution>
Expand Down Expand Up @@ -256,7 +257,7 @@
<dependency>
<groupId>rubygems</groupId>
<artifactId>rspec</artifactId>
<version>[2.14,2.99999]</version>
<version>[3.0,3.99999]</version>
<type>gem</type>
</dependency>
<dependency>
Expand Down Expand Up @@ -296,11 +297,12 @@
<configuration>
<scope>compile</scope>
<gems>
<rspec>2.99.0</rspec>
<rspec-core>2.99.2</rspec-core>
<rspec-expectations>2.99.2</rspec-expectations>
<rspec>3.3.0</rspec>
<rspec-core>3.3.1</rspec-core>
<rspec-support>3.3.0</rspec-support>
<rspec-expectations>3.3.0</rspec-expectations>
<diff-lcs>1.2.5</diff-lcs>
<rspec-mocks>2.99.2</rspec-mocks>
<rspec-mocks>3.3.1</rspec-mocks>
<rake>10.3.2</rake>
<jbundler>0.7.1</jbundler>
<jar-dependencies>0.1.7</jar-dependencies>
Expand Down
16 changes: 10 additions & 6 deletions maven/jruby/src/it/runnable/spec/one_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

describe "something" do
it "does something" do
__FILE__.should == 'uri:classloader:/spec/one_spec.rb'
$CLASSPATH.size.should == 4
Jars.home.should == 'uri:classloader://'
Dir.pwd.should == 'uri:classloader://'
expect(__FILE__).to eq 'uri:classloader:/spec/one_spec.rb'
expect($CLASSPATH.size).to eq 4
expect(Jars.home).to eq 'uri:classloader://'
expect(Dir.pwd).to eq 'uri:classloader://'
$LOAD_PATH.each do |lp|
# bundler or someone else messes up the $LOAD_PATH
unless ["uri", "classloader", "//gems/bundler-1.7.7/lib"].member?( lp )
lp.should =~ /^uri:classloader:|runnable.jar!\//
unless ["uri", "classloader", "//gems/bundler-1.7.7/lib", "/gems/rspec-core-3.3.1/lib", "/gems/rspec-support-3.3.0/lib" ].member?( lp )
expect(lp).to match /^uri:classloader:|runnable.jar!\//
end
end
end

it 'see the Helper module from spec_helper' do
expect( defined? Helper ).to eq('constant')
end
end
2 changes: 2 additions & 0 deletions maven/jruby/src/it/runnable/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Helper
end

0 comments on commit 114a39e

Please sign in to comment.