File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,13 @@ class Test < Base
2222
2323 def run
2424 puts tester . test ( compline ) . join "\n "
25- return unless args [ '--keep' ]
2625
27- File . write 'completely-tester.sh' , tester_script
28- puts 'saved completely-tester.sh'
26+ if args [ '--keep' ]
27+ File . write 'completely-tester.sh' , tester_script
28+ puts 'saved completely-tester.sh'
29+ end
30+
31+ syntax_warning unless completions . valid?
2932 end
3033
3134 private
Original file line number Diff line number Diff line change 6565 . to raise_approval ( 'cli/test/error' )
6666 end
6767 end
68+
69+ context 'with an invalid configuration' do
70+ before do
71+ reset_tmp_dir
72+ File . write 'spec/tmp/in.yaml' , { 'one' => %w[ anything ] , 'two' => %w[ something ] } . to_yaml
73+ ENV [ 'COMPLETELY_CONFIG_PATH' ] = 'spec/tmp/in.yaml'
74+ end
75+
76+ it 'outputs a warning to STDERR' do
77+ expect { subject . execute %w[ test on ] } . to output_approval ( 'cli/warning' ) . to_stderr
78+ end
79+ end
6880end
You can’t perform that action at this time.
0 commit comments