Skip to content

Commit 32e1a62

Browse files
committed
fix to run tests
1 parent 42b2278 commit 32e1a62

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://rubygems.org/'
22

33
gemspec
4+
gem 'embulk'
45
gem 'embulk-parser-none'
56
gem 'embulk-parser-jsonl'
67
gem 'pry-nav'

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,23 +455,34 @@ $ curl -o embulk.jar --create-dirs -L "http://dl.embulk.org/embulk-latest.jar"
455455
$ chmod a+x embulk.jar
456456
```
457457
458-
Investigate JRUBY\_VERSION included in the embulk.jar:
458+
Investigate JRUBY\_VERSION and Bundler::VERSION included in the embulk.jar:
459459
460460
```
461461
$ echo JRUBY_VERSION | ./embulk.jar irb
462462
2019-08-10 00:59:11.866 +0900: Embulk v0.9.17
463463
Switch to inspect mode.
464464
JRUBY_VERSION
465465
"X.X.X.X"
466+
467+
$ echo "require 'bundler'; Bundler::VERSION" | ./embulk.jar irb
468+
2019-08-10 01:59:10.460 +0900: Embulk v0.9.17
469+
Switch to inspect mode.
470+
require 'bundler'; Bundler::VERSION
471+
"Y.Y.Y"
466472
```
467473
468-
Install the same version of jruby (change X.X.X.X to the version shown above):
474+
Install the same version of jruby (change X.X.X.X to the version shown above) and bundler:
469475
470476
```
471477
$ rbenv install jruby-X.X.X.X
472478
$ rbenv local jruby-X.X.X.X
473-
$ gem install bundler
474-
$ bundle install
479+
$ gem install bundler -v Y.Y.Y
480+
```
481+
482+
Install dependencies (NOTE: Use bundler included in the embulk.jar, otherwise, `gem 'embulk'` is not found):
483+
484+
```
485+
$ ./embulk.jar bundle install --path vendor/bundle
475486
```
476487
477488
Run tests with `env RUBYOPT="-r ./embulk.jar`:

test/test_example.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require_relative './helper'
2+
require 'bundler'
23

34
# 1. Prepare example/your-project-000.json
45
# 2. embulk bundle
@@ -9,8 +10,10 @@
910
else
1011
class TestExample < Test::Unit::TestCase
1112
def embulk_path
12-
if File.exist?("#{ENV['PATH']}/.embulk/bin/embulk")
13-
"#{ENV['PATH']}/.embulk/bin/embulk"
13+
if File.exist?("#{ENV['HOME']}/.embulk/bin/embulk")
14+
"#{ENV['HOME']}/.embulk/bin/embulk"
15+
elsif File.exist?("#{ENV['PWD']}/embulk.jar")
16+
"#{ENV['PWD']}/embulk.jar"
1417
elsif File.exist?("/usr/local/bin/embulk")
1518
"/usr/local/bin/embulk"
1619
else
@@ -19,7 +22,7 @@ def embulk_path
1922
end
2023

2124
def embulk_run(config_path)
22-
Bundler.with_clean_env do
25+
::Bundler.with_clean_env do
2326
cmd = "#{embulk_path} run -X page_size=1 -b . -l trace #{config_path}"
2427
puts "=" * 64
2528
puts cmd

0 commit comments

Comments
 (0)