Skip to content

Commit f8fa20e

Browse files
committed
rake test to run integration tests
1 parent 1e5f64f commit f8fa20e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

Rakefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,22 @@ Rake::TestTask.new do |task|
2828
task.verbose = true
2929
task.loader = :direct
3030
end
31-
task :test => 'lib/jopenssl.jar'
31+
task :test => 'lib/jopenssl.jar'
32+
33+
namespace :integration do
34+
it_path = File.expand_path('../src/test/integration', __FILE__)
35+
task :install do
36+
Dir.chdir(it_path) do
37+
ruby "-S bundle install --gemfile '#{it_path}/Gemfile'"
38+
end
39+
end
40+
# desc "Run IT tests"
41+
task :test => 'lib/jopenssl.jar' do
42+
unless File.exist?(File.join(it_path, 'Gemfile.lock'))
43+
raise "bundle not installed, run `rake integration:install'"
44+
end
45+
loader = "ARGV.each { |f| require f }"
46+
test_files = FileList['src/test/integration/*_test.rb'].to_a
47+
ruby "-Ilib -e \"#{loader}\" #{test_files.map { |f| "\"#{f}\"" }.join(' ')}"
48+
end
49+
end

0 commit comments

Comments
 (0)