From 87f4d0bd15cb8d6cb9f96ccbd31de921f741c651 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Mon, 17 Nov 2014 21:36:05 +0000 Subject: [PATCH] Fix warning expectation specs --- ...ng_expectation.rb => warning_expectation_spec.rb} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename spec/unit/mutant/{warning_expectation.rb => warning_expectation_spec.rb} (83%) diff --git a/spec/unit/mutant/warning_expectation.rb b/spec/unit/mutant/warning_expectation_spec.rb similarity index 83% rename from spec/unit/mutant/warning_expectation.rb rename to spec/unit/mutant/warning_expectation_spec.rb index e48bc9ef..2388f425 100644 --- a/spec/unit/mutant/warning_expectation.rb +++ b/spec/unit/mutant/warning_expectation_spec.rb @@ -49,7 +49,7 @@ RSpec.describe Mutant::WarningExpectation do let(:expected_warnings) { [warning_a] } it 'raises an expectation error' do - expect { subject }.to raise_error(Mutant::WarningExpectation::ExpectationError.new(expected_warnings)) + expect { subject }.to raise_error(Mutant::WarningExpectation::ExpectationError.new([warning_b], expected_warnings)) end end @@ -64,9 +64,17 @@ RSpec.describe Mutant::WarningExpectation do let(:actual_warnings) { [warning_b] } it 'raises an expectation error' do - expect { subject }.to raise_error(Mutant::WarningExpectation::ExpectationError.new([warning_b])) + expect { subject }.to raise_error(Mutant::WarningExpectation::ExpectationError.new([warning_b], expected_warnings)) end end end end end + +RSpec.describe Mutant::WarningExpectation::ExpectationError do + describe '#message' do + subject { described_class.new(['unexpected-a'], ['expected-b']).message } + + it { should eql('Unexpected warnings: ["unexpected-a"], expected: ["expected-b"]') } + end +end