Skip to content

Commit 686ece4

Browse files
committed
fix specs
1 parent 28e6843 commit 686ece4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

spec/bashly/commands/generate_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
expect { subject.execute %w[generate --wrap function] }.to output_approval('cli/generate/wrap-function')
103103
expect(File).to exist(cli_script)
104104
lines = File.readlines cli_script
105-
expect(lines[0..10].join).to match_approval('cli/generate/wrap-script').except(/\d+\.\d+\.\d+/)
105+
expect(lines[0..10].join).to match_approval('cli/generate/wrap-script')
106+
.except(/\d+\.\d+\.\d+(\.rc\d)?/)
106107
end
107108
end
108109

spec/bashly/script/wrapper_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
context 'without function name' do
1212
it 'returns the complete script' do
1313
lines = subject.code.split "\n"
14-
expect(lines[0..13].join("\n")).to match_approval('script/wrapper/code').except(/\d+\.\d+\.\d+/)
14+
expect(lines[0..13].join("\n")).to match_approval('script/wrapper/code')
15+
.except(/\d+\.\d+\.\d+(\.rc\d)?/)
1516
expect(lines[-1]).to eq 'run "$@"'
1617
end
1718
end
@@ -21,7 +22,8 @@
2122

2223
it 'returns the complete script wrapped in a function without a bash3 bouncer' do
2324
lines = subject.code.split "\n"
24-
expect(lines[0..13].join("\n")).to match_approval('script/wrapper/code-wrapped').except(/\d+\.\d+\.\d+/)
25+
expect(lines[0..13].join("\n")).to match_approval('script/wrapper/code-wrapped')
26+
.except(/\d+\.\d+\.\d+(\.rc\d)?/)
2527
expect(lines[-1]).to eq '(return 0 2>/dev/null) || my_super_function "$@"'
2628
end
2729
end

0 commit comments

Comments
 (0)