Skip to content

Commit daf27be

Browse files
committed
add specs for COMPLETELY_SCRIPT_PATH
1 parent a484ff4 commit daf27be

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Saved spec/tmp/tada.bash

spec/completely/commands/generate_spec.rb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,30 @@
3838
system "rm -f hello.bash"
3939
end
4040

41-
it "generates the bash script to completely.bash" do
41+
it "generates the bash script to hello.bash" do
4242
expect { subject.run %w[generate] }.to output_approval('cli/generate/custom-path-env')
4343
expect(File.read "hello.bash").to match_approval('cli/generated-script')
4444
end
4545
end
4646

47+
context "with COMPLETELY_SCRIPT_PATH env var" do
48+
let(:outfile) { 'spec/tmp/tada.bash' }
49+
50+
before do
51+
reset_tmp_dir
52+
ENV['COMPLETELY_SCRIPT_PATH'] = outfile
53+
end
54+
55+
after do
56+
ENV['COMPLETELY_SCRIPT_PATH'] = nil
57+
end
58+
59+
it "generates the bash script to the requested path" do
60+
expect { subject.run %w[generate] }.to output_approval('cli/generate/custom-path-env2')
61+
expect(File.read outfile).to match_approval('cli/generated-script')
62+
end
63+
end
64+
4765
context "with CONFIG_PATH SCRIPT_PATH" do
4866
before { reset_tmp_dir }
4967

0 commit comments

Comments
 (0)