|
5 | 5 |
|
6 | 6 | subject { Maven::Ruby::Maven.new } |
7 | 7 |
|
| 8 | + let(:pkg) { File.expand_path("../pkg", __dir__) } |
| 9 | + |
8 | 10 | it 'shows mvn commandline with verbose flag' do |
9 | | - CatchStdout.exec do |
| 11 | + out, _ = capture_subprocess_io do |
10 | 12 | subject.exec( '-Dverbose', 'validate' ) |
11 | 13 | end |
12 | 14 | subject.verbose = false |
13 | | - _(CatchStdout.result).must_match /mvn -Dverbose validate/ |
| 15 | + _(out).must_match /mvn -Dverbose validate/ |
14 | 16 | end |
15 | 17 |
|
16 | 18 | it 'takes declared jruby version' do |
17 | 19 | begin |
18 | 20 | subject.inherit_jruby_version '9.0.4.0' |
19 | | - subject.exec( '-X', 'initialize', '-l', 'pkg/log1.txt' ) |
20 | | - _(File.read('pkg/log1.txt')).must_match /resolve jruby for version 9.0.4.0/ |
| 21 | + out, _ = capture_subprocess_io do |
| 22 | + subject.exec( '-X', 'initialize') |
| 23 | + end |
| 24 | + _(out).must_match /resolve jruby for version 9.0.4.0/ |
21 | 25 | ensure |
22 | 26 | subject['jruby.version'] = nil |
23 | 27 | end |
|
26 | 30 | if defined? JRUBY_VERSION |
27 | 31 | it 'inherits jruby version' do |
28 | 32 | subject.inherit_jruby_version |
29 | | - subject.exec( '-X', 'initialize', '-l', 'pkg/log2.txt' ) |
30 | | - _(File.read('pkg/log2.txt')).must_match /resolve jruby for version #{JRUBY_VERSION}/ |
| 33 | + out, _ = capture_subprocess_io do |
| 34 | + subject.exec( '-X', 'initialize') |
| 35 | + end |
| 36 | + _(out).must_match /resolve jruby for version #{JRUBY_VERSION}/ |
31 | 37 | end |
32 | 38 | else |
33 | 39 | it 'takes default jruby version with inherit jruby version' do |
34 | 40 | subject.inherit_jruby_version |
35 | | - subject.exec( '-X', 'initialize', '-l', 'pkg/log3.txt' ) |
36 | | - _(File.read('pkg/log3.txt')).must_match /resolve jruby for version 9.3.1.0/ |
| 41 | + out, _ = capture_subprocess_io do |
| 42 | + subject.exec( '-X', 'initialize') |
| 43 | + end |
| 44 | + _(out).must_match /resolve jruby for version 9.3.1.0/ |
37 | 45 | end |
38 | 46 | end |
39 | 47 | end |
0 commit comments