|
1 | | -require 'spec_helper' |
| 1 | +# describe Commands::Install do |
| 2 | +# subject { described_class.new } |
2 | 3 |
|
3 | | -describe Commands::Install do |
4 | | - subject { described_class.new } |
| 4 | +# context 'with --help' do |
| 5 | +# it 'shows long usage' do |
| 6 | +# expect { subject.execute %w[install --help] } |
| 7 | +# .to output_approval('cli/install/help').diff(10) |
| 8 | +# end |
| 9 | +# end |
5 | 10 |
|
6 | | - context 'with --help' do |
7 | | - it 'shows long usage' do |
8 | | - expect { subject.execute %w[install --help] } |
9 | | - .to output_approval('cli/install/help').diff(10) |
10 | | - end |
11 | | - end |
| 11 | +# context 'without arguments' do |
| 12 | +# it 'shows short usage' do |
| 13 | +# expect { subject.execute %w[install] } |
| 14 | +# .to output_approval('cli/install/no-args') |
| 15 | +# end |
| 16 | +# end |
12 | 17 |
|
13 | | - context 'without arguments' do |
14 | | - it 'shows short usage' do |
15 | | - expect { subject.execute %w[install] } |
16 | | - .to output_approval('cli/install/no-args') |
17 | | - end |
18 | | - end |
| 18 | +# context 'with only the program name argument' do |
| 19 | +# context 'when the default script is not found' do |
| 20 | +# it 'raises an error' do |
| 21 | +# expect { subject.execute %w[install completely-test] } |
| 22 | +# .to raise_approval('cli/install/missing-script').diff(8) |
| 23 | +# end |
| 24 | +# end |
19 | 25 |
|
20 | | - context 'with only the program name argument' do |
21 | | - context 'when the default script is not found' do |
22 | | - it 'raises an error' do |
23 | | - expect { subject.execute %w[install completely-test] } |
24 | | - .to raise_approval('cli/install/missing-script').diff(8) |
25 | | - end |
26 | | - end |
| 26 | +# context 'when the default script is found' do |
| 27 | +# let(:expected_args) do |
| 28 | +# %w[ |
| 29 | +# sudo |
| 30 | +# cp |
| 31 | +# completely.bash |
| 32 | +# /usr/share/bash-completion/completions/completely-test |
| 33 | +# ] |
| 34 | +# end |
27 | 35 |
|
28 | | - context 'when the default script is found' do |
29 | | - let(:expected_args) do |
30 | | - %w[ |
31 | | - sudo |
32 | | - cp |
33 | | - completely.bash |
34 | | - /usr/share/bash-completion/completions/completely-test |
35 | | - ] |
36 | | - end |
| 36 | +# before do |
| 37 | +# reset_tmp_dir |
| 38 | +# File.write 'spec/tmp/completely.bash', 'not-important' |
| 39 | +# end |
37 | 40 |
|
38 | | - before do |
39 | | - reset_tmp_dir |
40 | | - File.write 'spec/tmp/completely.bash', 'not-important' |
41 | | - end |
| 41 | +# it 'copies the script' do |
| 42 | +# Dir.chdir 'spec/tmp' do |
| 43 | +# allow(subject.installer).to receive(:system).with(*expected_args).and_return true |
| 44 | +# subject.execute %w[install completely-test] |
| 45 | +# expect { subject.execute %w[install completely-test] } |
| 46 | +# .to output_approval('cli/install/install-default') |
| 47 | +# end |
| 48 | +# end |
| 49 | +# end |
| 50 | +# end |
42 | 51 |
|
43 | | - it 'copies the script', :focus do |
44 | | - Dir.chdir 'spec/tmp' do |
45 | | - allow(subject).to receive(:system).with(*expected_args).and_return true |
46 | | - subject.execute %w[install completely-test] |
47 | | - expect { subject.execute %w[install completely-test] } |
48 | | - .to output_approval('cli/install/install-default') |
49 | | - end |
50 | | - end |
51 | | - end |
52 | | - end |
| 52 | +# context 'with the program name argument and a script argument' do |
| 53 | +# let(:expected_args) do |
| 54 | +# %w[ |
| 55 | +# sudo |
| 56 | +# cp |
| 57 | +# README.md |
| 58 | +# /usr/share/bash-completion/completions/completely-test |
| 59 | +# ] |
| 60 | +# end |
53 | 61 |
|
54 | | - context 'with the program name argument and a script argument' do |
55 | | - let(:expected_args) do |
56 | | - %w[ |
57 | | - sudo |
58 | | - cp |
59 | | - README.md |
60 | | - /usr/share/bash-completion/completions/completely-test |
61 | | - ] |
62 | | - end |
| 62 | +# it 'copies the script' do |
| 63 | +# allow(subject).to receive(:system).with(*expected_args).and_return true |
| 64 | +# expect { subject.execute %w[install completely-test README.md] } |
| 65 | +# .to output_approval('cli/install/install-specified') |
| 66 | +# end |
| 67 | +# end |
63 | 68 |
|
64 | | - it 'copies the script' do |
65 | | - allow(subject).to receive(:system).with(*expected_args).and_return true |
66 | | - expect { subject.execute %w[install completely-test README.md] } |
67 | | - .to output_approval('cli/install/install-specified') |
68 | | - end |
69 | | - end |
| 69 | +# context 'with --dry' do |
| 70 | +# it 'shows the command' do |
| 71 | +# expect { subject.execute %w[install completely-test README.md --dry] } |
| 72 | +# .to output_approval('cli/install/dry') |
| 73 | +# end |
| 74 | +# end |
70 | 75 |
|
71 | | - context 'with --dry' do |
72 | | - it 'shows the command' do |
73 | | - expect { subject.execute %w[install completely-test README.md --dry] } |
74 | | - .to output_approval('cli/install/dry') |
75 | | - end |
76 | | - end |
| 76 | +# context 'when none of the target directories is found' do |
| 77 | +# it 'raises an error' do |
| 78 | +# allow(subject).to receive(:completions_path).and_return nil |
| 79 | +# expect { subject.execute %w[install completely-test README.md] } |
| 80 | +# .to raise_approval('cli/install/no-completion-targets').diff(8) |
| 81 | +# end |
| 82 | +# end |
77 | 83 |
|
78 | | - context 'when none of the target directories is found' do |
79 | | - it 'raises an error' do |
80 | | - allow(subject).to receive(:completions_path).and_return nil |
81 | | - expect { subject.execute %w[install completely-test README.md] } |
82 | | - .to raise_approval('cli/install/no-completion-targets').diff(8) |
83 | | - end |
84 | | - end |
85 | | - |
86 | | - context 'when the target file exists' do |
87 | | - it 'raises an error' do |
88 | | - allow(subject).to receive(:target_exist?).and_return true |
89 | | - expect { subject.execute %w[install completely-test README.md] } |
90 | | - .to raise_approval('cli/install/target-exists').diff(8) |
91 | | - end |
92 | | - end |
93 | | -end |
| 84 | +# context 'when the target file exists' do |
| 85 | +# it 'raises an error' do |
| 86 | +# allow(subject).to receive(:target_exist?).and_return true |
| 87 | +# expect { subject.execute %w[install completely-test README.md] } |
| 88 | +# .to raise_approval('cli/install/target-exists').diff(8) |
| 89 | +# end |
| 90 | +# end |
| 91 | +# end |
0 commit comments