Skip to content

Commit 188bd9e

Browse files
committed
complete test coverage
1 parent 1d8715c commit 188bd9e

File tree

4 files changed

+28
-60
lines changed

4 files changed

+28
-60
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
creating user files in spec/tmp/src
2+
skipped spec/tmp/src/initialize.sh (exists)
3+
skipped spec/tmp/src/download_command.sh (exists)
4+
skipped spec/tmp/src/upload_command.sh (exists)
5+
warning not upgrading spec/tmp/src/lib/colors.sh, unknown library 'no-such-lib'
6+
updated spec/tmp/src/lib/config.sh
7+
updated spec/tmp/src/lib/send_completions.sh
8+
updated spec/tmp/src/lib/validations/validate_dir_exists.sh
9+
updated spec/tmp/src/lib/validations/validate_file_exists.sh
10+
updated spec/tmp/src/lib/validations/validate_integer.sh
11+
updated spec/tmp/src/lib/validations/validate_not_empty.sh
12+
updated spec/tmp/src/lib/yaml.sh
13+
created spec/tmp/cli
14+
run spec/tmp/cli --help to test your bash script

spec/approvals/fixtures/lib-upgrade

Lines changed: 0 additions & 35 deletions
This file was deleted.

spec/approvals/library/base/dir

Lines changed: 0 additions & 25 deletions
This file was deleted.

spec/bashly/commands/generate_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,19 @@
145145
end
146146
end
147147

148+
context "when the upgrade candidate has magic comment with an unknown library" do
149+
let(:file) { lib_files[0] }
150+
let(:patched_content) { file_content.gsub "[@bashly-upgrade colors]", "[@bashly-upgrade no-such-lib]" }
151+
let(:file_content) { File.read file }
152+
153+
before do
154+
File.write file, patched_content
155+
end
156+
157+
it "shows a warning" do
158+
expect { subject.run %w[generate -u] }.to output_approval('cli/generate/upgrade-unknown-lib')
159+
end
160+
end
161+
148162
end
149163
end

0 commit comments

Comments
 (0)