|
19 | 19 | describe 'detect' do |
20 | 20 |
|
21 | 21 | it 'should return non-zero if the application is not Java' do |
22 | | - Open3.popen3("#{DETECT} #{FIXTURES_DIR}/non-java") do |stdin, stdout, stderr, wait_thr| |
23 | | - expect(stdout.read).to eq('') |
24 | | - expect(stderr.read).to eq('') |
| 22 | + Open3.popen3("bin/detect spec/fixtures/non-java") do |stdin, stdout, stderr, wait_thr| |
25 | 23 | expect(wait_thr.value).to_not be_success |
26 | 24 | end |
27 | 25 | end |
28 | 26 |
|
29 | 27 | it 'should return zero if the application is Java' do |
30 | | - # TODO Implement test as things are filled out |
| 28 | + Open3.popen3("bin/detect spec/fixtures/java") do |stdin, stdout, stderr, wait_thr| |
| 29 | + expect(wait_thr.value).to be_success |
| 30 | + end |
31 | 31 | end |
32 | 32 |
|
33 | 33 | it 'should print the names of participating components if the application is Java' do |
34 | | - # TODO Implement test as things are filled out |
35 | | - end |
36 | | - |
37 | | - it 'should return non-zero if an error occurs' do |
38 | | - # TODO Implement test as things are filled out |
39 | | - end |
40 | | - |
41 | | - it 'should print the error message if an error occurs' do |
42 | | - # TODO Implement test as things are filled out |
| 34 | + Open3.popen3("bin/detect spec/fixtures/java") do |stdin, stdout, stderr, wait_thr| |
| 35 | + expect(stdout.read).to match(/java-openjdk-8/) |
| 36 | + end |
43 | 37 | end |
44 | 38 |
|
45 | | - private |
46 | | - |
47 | | - DETECT = File.expand_path('../../../bin/detect', __FILE__) |
48 | | - FIXTURES_DIR = File.expand_path('../../fixtures', __FILE__) |
49 | | - |
50 | 39 | end |
0 commit comments