use stdout
This commit is contained in:
@ -7,8 +7,8 @@ class MochaAdapter < TestingFrameworkAdapter
|
||||
end
|
||||
|
||||
def parse_output(output)
|
||||
matches_success = SUCCESS_REGEXP.match(output[:stderr])
|
||||
matches_failed = FAILURES_REGEXP.match(output[:stderr])
|
||||
matches_success = SUCCESS_REGEXP.match(output[:stdout])
|
||||
matches_failed = FAILURES_REGEXP.match(output[:stdout])
|
||||
failed = matches_failed ? matches_failed.captures.first.to_i : 0
|
||||
success = matches_success ? matches_success.captures.first.to_i : 0
|
||||
{count: success+failed, failed: failed}
|
||||
|
@ -4,11 +4,11 @@ describe MochaAdapter do
|
||||
let(:adapter) { described_class.new }
|
||||
let(:count) { 42 }
|
||||
let(:failed) { 25 }
|
||||
let(:stderr) { "#{count-failed} passing (20ms)\n\n#{failed} failing" }
|
||||
let(:stdout) { "#{count-failed} passing (20ms)\n\n#{failed} failing" }
|
||||
|
||||
describe '#parse_output' do
|
||||
it 'returns the correct numbers' do
|
||||
expect(adapter.parse_output(stderr: stderr)).to eq(count: count, failed: failed)
|
||||
expect(adapter.parse_output(stdout: stdout)).to eq(count: count, failed: failed)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user