use stdout

This commit is contained in:
Jan Renz
2015-06-18 20:13:43 +02:00
parent 278e30ccf8
commit 6af614ca7c
2 changed files with 4 additions and 4 deletions

View File

@ -7,8 +7,8 @@ class MochaAdapter < TestingFrameworkAdapter
end end
def parse_output(output) def parse_output(output)
matches_success = SUCCESS_REGEXP.match(output[:stderr]) matches_success = SUCCESS_REGEXP.match(output[:stdout])
matches_failed = FAILURES_REGEXP.match(output[:stderr]) matches_failed = FAILURES_REGEXP.match(output[:stdout])
failed = matches_failed ? matches_failed.captures.first.to_i : 0 failed = matches_failed ? matches_failed.captures.first.to_i : 0
success = matches_success ? matches_success.captures.first.to_i : 0 success = matches_success ? matches_success.captures.first.to_i : 0
{count: success+failed, failed: failed} {count: success+failed, failed: failed}

View File

@ -4,11 +4,11 @@ describe MochaAdapter do
let(:adapter) { described_class.new } let(:adapter) { described_class.new }
let(:count) { 42 } let(:count) { 42 }
let(:failed) { 25 } 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 describe '#parse_output' do
it 'returns the correct numbers' 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 end
end end