Add fail mode to test_hook.rb
This commit is contained in:
parent
2e59062454
commit
8d8471951a
2 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
output = []
|
||||
$stdin.readlines.each do |line|
|
||||
exit 0 if line.chomp == '#clear'
|
||||
exit 1 if line.chomp == '#fail'
|
||||
output << line.gsub(/([^\s]*)\s*=\s*(.*)/, '\1 = \2')
|
||||
end
|
||||
|
||||
|
|
|
@ -14,6 +14,10 @@ describe 'Test Hook' do
|
|||
expect(out).to eq ''
|
||||
end
|
||||
|
||||
it 'fails with a #fail line' do
|
||||
expect { run '#fail' }.to raise_error
|
||||
end
|
||||
|
||||
def run(input)
|
||||
result = IO.popen ['ruby', "#{__dir__}/test_hook.rb"], mode: File::RDWR do |io|
|
||||
io.write input
|
||||
|
|
Loading…
Add table
Reference in a new issue