Skip to content

Commit 0bde615

Browse files
committed
cd to test dir so that rake test works + setup CLASSPATH with absolute dirs
1 parent 59fecb2 commit 0bde615

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Rake::TestTask.new do |task|
4242
task.test_files = test_files.map { |path| path.sub('src/test/ruby/', '') }
4343
task.verbose = true
4444
task.loader = :direct
45+
task.ruby_opts = [ '-C', 'src/test/ruby', '-rbundler/setup' ]
4546
end
4647
task :test => 'lib/jopenssl.jar'
4748

src/test/ruby/test_helper.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010

1111
puts Java::OrgBouncycastleJceProvider::BouncyCastleProvider.new.info
1212
else
13-
$CLASSPATH << 'pkg/classes'
14-
jar = Dir['lib/org/bouncycastle/**/bcprov-*.jar'].first
13+
base_dir = File.expand_path('../../..', File.dirname(__FILE__))
14+
$CLASSPATH << File.join(base_dir, 'pkg/classes')
15+
jar = Dir[File.join(base_dir, 'lib/org/bouncycastle/**/bcprov-*.jar')].first
1516
raise "bcprov jar not found" unless jar; $CLASSPATH << jar
16-
jar = Dir['lib/org/bouncycastle/**/bcpkix-*.jar'].first
17+
jar = Dir[File.join(base_dir, 'lib/org/bouncycastle/**/bcpkix-*.jar')].first
1718
raise "bcpkix jar not found" unless jar; $CLASSPATH << jar
1819
end if defined? JRUBY_VERSION
1920

0 commit comments

Comments
 (0)