|
11 | 11 |
|
12 | 12 | it 'should raise error when script cannot be found' do |
13 | 13 | opts = { |
14 | | - default_script: 'git-extract/THIS-DOES-NOT-EXIST', |
| 14 | + default_script: 'env/THIS-DOES-NOT-EXIST', |
15 | 15 | working_dir: File.dirname(__FILE__), |
16 | 16 | logger: @logger |
17 | 17 | } |
18 | 18 | expect { described_class.new(opts) }.to raise_error(Errno::ENOENT) |
19 | 19 | end |
20 | 20 |
|
21 | | - it 'should raise error when working directory cannot be found' do |
22 | | - opts = { |
23 | | - default_script: 'git-extract/git-extract.sh', |
24 | | - working_dir: File.join(File.dirname(__FILE__), 'THIS-DOES-NOT-EXIST'), |
25 | | - logger: @logger |
26 | | - } |
27 | | - expect { described_class.new(opts) }.to raise_error(Errno::ENOENT) |
28 | | - end |
29 | | - |
30 | 21 | it 'should use override script when it is found' do |
31 | 22 | opts = { |
32 | 23 | default_script: 'asdflkjasf/scriptrunner_spec.rb', |
|
41 | 32 |
|
42 | 33 | it 'should use default script when override is not found' do |
43 | 34 | opts = { |
44 | | - default_script: 'git-extract/git-extract.sh', |
| 35 | + default_script: 'env/env.sh', |
45 | 36 | working_dir: File.join(File.dirname(__FILE__)), |
46 | 37 | override_script_path: File.join(File.dirname(__FILE__)), |
47 | 38 | logger: @logger |
48 | 39 | } |
49 | 40 | obj = described_class.new(opts) |
50 | | - answer = File.expand_path('../../../../scripts/git-extract/git-extract.sh', File.dirname(__FILE__)) |
| 41 | + answer = File.expand_path('../../../../scripts/env/env.sh', File.dirname(__FILE__)) |
51 | 42 | expect(obj.script).to eq(answer) |
52 | | - expect(@logger_str.string).to match(/Did not find.+git-extract.sh in override script path/) |
| 43 | + expect(@logger_str.string).to match(/Did not find.+env.sh in override script path/) |
53 | 44 | end |
54 | 45 |
|
55 | 46 | it 'should use default script when override is not provided' do |
56 | 47 | opts = { |
57 | | - default_script: 'git-extract/git-extract.sh', |
| 48 | + default_script: 'env/env.sh', |
58 | 49 | working_dir: File.join(File.dirname(__FILE__)), |
59 | 50 | logger: @logger |
60 | 51 | } |
61 | 52 | obj = described_class.new(opts) |
62 | | - answer = File.expand_path('../../../../scripts/git-extract/git-extract.sh', File.dirname(__FILE__)) |
| 53 | + answer = File.expand_path('../../../../scripts/env/env.sh', File.dirname(__FILE__)) |
63 | 54 | expect(obj.script).to eq(answer) |
64 | 55 | expect(@logger_str.string).to eq('') |
65 | 56 | end |
66 | 57 | end |
| 58 | + |
| 59 | + describe '#run' do |
| 60 | + before(:each) do |
| 61 | + @logger, @logger_str = OctocatalogDiff::Spec.setup_logger |
| 62 | + @described_obj = described_class.new( |
| 63 | + default_script: 'env/env.sh', |
| 64 | + logger: @logger |
| 65 | + ) |
| 66 | + end |
| 67 | + |
| 68 | + it 'should raise error when working directory cannot be found' do |
| 69 | + opts = { |
| 70 | + working_dir: File.join(File.dirname(__FILE__), 'THIS-DOES-NOT-EXIST') |
| 71 | + } |
| 72 | + expect { @described_obj.run(opts) }.to raise_error(Errno::ENOENT) |
| 73 | + end |
| 74 | + end |
67 | 75 | end |
0 commit comments