diff --git a/lib/mocha_adapter.rb b/lib/mocha_adapter.rb index ab822c28..a5b8469d 100644 --- a/lib/mocha_adapter.rb +++ b/lib/mocha_adapter.rb @@ -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} diff --git a/spec/lib/mocha_adapter_spec.rb b/spec/lib/mocha_adapter_spec.rb index ab2f74f4..ed3b1685 100644 --- a/spec/lib/mocha_adapter_spec.rb +++ b/spec/lib/mocha_adapter_spec.rb @@ -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