From c4ce08e3b84c1cf06d1ea003bca8095f1792401b Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 23 Jun 2013 21:57:12 +0200 Subject: [PATCH] Display original code in shared mutator error message --- spec/shared/mutator_behavior.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/shared/mutator_behavior.rb b/spec/shared/mutator_behavior.rb index 796af68a..620cc224 100644 --- a/spec/shared/mutator_behavior.rb +++ b/spec/shared/mutator_behavior.rb @@ -65,6 +65,7 @@ shared_examples_for 'a mutator' do end it 'generates the expected mutations' do + generated = subject.map { |node| Subject.new(node) } missing = expected_mutations - generated @@ -82,7 +83,7 @@ shared_examples_for 'a mutator' do message.concat(unexpected) end - fail message.join("\n-----\n") if message.any? + fail "Original:\n#{generate(node)}\n-----\n#{message.join("\n-----\n")}" if message.any? end end end