File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 102
102
expect { subject . execute %w[ generate --wrap function ] } . to output_approval ( 'cli/generate/wrap-function' )
103
103
expect ( File ) . to exist ( cli_script )
104
104
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 )?/ )
106
107
end
107
108
end
108
109
Original file line number Diff line number Diff line change 11
11
context 'without function name' do
12
12
it 'returns the complete script' do
13
13
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 )?/ )
15
16
expect ( lines [ -1 ] ) . to eq 'run "$@"'
16
17
end
17
18
end
21
22
22
23
it 'returns the complete script wrapped in a function without a bash3 bouncer' do
23
24
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 )?/ )
25
27
expect ( lines [ -1 ] ) . to eq '(return 0 2>/dev/null) || my_super_function "$@"'
26
28
end
27
29
end
You can’t perform that action at this time.
0 commit comments