Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
Index: rspec_on_rails/spec/rails/matchers/assert_select_spec.rb =================================================================== --- rspec_on_rails/spec/rails/matchers/assert_select_spec.rb (revision 2153) +++ rspec_on_rails/spec/rails/matchers/assert_select_spec.rb (working copy) @@ -180,13 +180,13 @@ response.should have_tag("div#?", /\d+/) do |elements| elements.size.should == 3 end - }.should raise_error(SpecFailed, "expected 3, got 2 (using ==)") + }.should raise_error(SpecFailed, "expected: 3,\ngot : 2 (using ==)") lambda { response.should have_tag("div#?", /\d+/) { |elements| elements.size.should == 3 } - }.should raise_error(SpecFailed, "expected 3, got 2 (using ==)") + }.should raise_error(SpecFailed, "expected: 3,\ngot : 2 (using ==)") response.should have_tag("div#?", /\d+/) do |elements| elements.size.should == 2 Index: rspec/lib/spec/matchers/operator_matcher.rb =================================================================== --- rspec/lib/spec/matchers/operator_matcher.rb (revision 2153) +++ rspec/lib/spec/matchers/operator_matcher.rb (working copy) @@ -52,8 +52,8 @@ def __delegate_method_missing_to_target(operator, expected) ::Spec::Matchers.generated_description = "should #{operator} #{expected.inspect}" return if @target.send(operator, expected) - return fail_with_message("expected #{expected.inspect}, got #{@target.inspect} (using #{operator})") if ['==','==='].include?(operator) - return fail_with_message("expected #{operator} #{expected.inspect}, got #{@target.inspect}") + return fail_with_message("expected: #{expected.inspect},\ngot : #{@target.inspect} (using #{operator})") if ['==','==='].include?(operator) + return fail_with_message("expected: #{operator} #{expected.inspect},\ngot : #{@target.inspect}") end end @@ -63,7 +63,7 @@ def __delegate_method_missing_to_target(operator, expected) ::Spec::Matchers.generated_description = "should not #{operator} #{expected.inspect}" return unless @target.send(operator, expected) - return fail_with_message("expected not #{operator} #{expected.inspect}, got #{@target.inspect}") + return fail_with_message("expected not: #{operator} #{expected.inspect},\ngot : #{@target.inspect}") end end Index: rspec/spec/spec/matchers/operator_matcher_spec.rb =================================================================== --- rspec/spec/spec/matchers/operator_matcher_spec.rb (revision 2153) +++ rspec/spec/spec/matchers/operator_matcher_spec.rb (working copy) @@ -12,7 +12,7 @@ it "should fail when target.==(actual) returns false" do subject = "apple" - Spec::Expectations.should_receive(:fail_with).with(%[expected "orange", got "apple" (using ==)], "orange", "apple") + Spec::Expectations.should_receive(:fail_with).with(%[expected: "orange",\ngot : "apple" (using ==)], "orange", "apple") subject.should == "orange" end @@ -28,7 +28,7 @@ it "should fail when target.==(actual) returns false" do subject = "apple" - Spec::Expectations.should_receive(:fail_with).with(%[expected not == "apple", got "apple"], "apple", "apple") + Spec::Expectations.should_receive(:fail_with).with(%[expected not: == "apple",\ngot : "apple"], "apple", "apple") subject.should_not == "apple" end @@ -45,7 +45,7 @@ it "should fail when target.===(actual) returns false" do subject = "apple" subject.should_receive(:===).with("orange").and_return(false) - Spec::Expectations.should_receive(:fail_with).with(%[expected "orange", got "apple" (using ===)], "orange", "apple") + Spec::Expectations.should_receive(:fail_with).with(%[expected: "orange",\ngot : "apple" (using ===)], "orange", "apple") subject.should === "orange" end @@ -62,7 +62,7 @@ it "should fail when target.===(actual) returns false" do subject = "apple" subject.should_receive(:===).with("apple").and_return(true) - Spec::Expectations.should_receive(:fail_with).with(%[expected not === "apple", got "apple"], "apple", "apple") + Spec::Expectations.should_receive(:fail_with).with(%[expected not: === "apple",\ngot : "apple"], "apple", "apple") subject.should_not === "apple" end @@ -79,7 +79,7 @@ it "should fail when target.=~(actual) returns false" do subject = "fu" subject.should_receive(:=~).with(/oo/).and_return(false) - Spec::Expectations.should_receive(:fail_with).with(%[expected =~ /oo/, got "fu"], /oo/, "fu") + Spec::Expectations.should_receive(:fail_with).with(%[expected: =~ /oo/,\ngot : "fu"], /oo/, "fu") subject.should =~ /oo/ end @@ -96,7 +96,7 @@ it "should fail when target.=~(actual) returns false" do subject = "foo" subject.should_receive(:=~).with(/oo/).and_return(true) - Spec::Expectations.should_receive(:fail_with).with(%[expected not =~ /oo/, got "foo"], /oo/, "foo") + Spec::Expectations.should_receive(:fail_with).with(%[expected not: =~ /oo/,\ngot : "foo"], /oo/, "foo") subject.should_not =~ /oo/ end @@ -109,7 +109,7 @@ end it "should fail if > fails" do - Spec::Expectations.should_receive(:fail_with).with(%[expected > 5, got 4], 5, 4) + Spec::Expectations.should_receive(:fail_with).with(%[expected: > 5,\ngot : 4], 5, 4) 4.should > 5 end @@ -123,7 +123,7 @@ end it "should fail if > fails" do - Spec::Expectations.should_receive(:fail_with).with(%[expected >= 5, got 4], 5, 4) + Spec::Expectations.should_receive(:fail_with).with(%[expected: >= 5,\ngot : 4], 5, 4) 4.should >= 5 end @@ -136,7 +136,7 @@ end it "should fail if > fails" do - Spec::Expectations.should_receive(:fail_with).with(%[expected < 3, got 4], 3, 4) + Spec::Expectations.should_receive(:fail_with).with(%[expected: < 3,\ngot : 4], 3, 4) 4.should < 3 end @@ -150,7 +150,7 @@ end it "should fail if > fails" do - Spec::Expectations.should_receive(:fail_with).with(%[expected <= 3, got 4], 3, 4) + Spec::Expectations.should_receive(:fail_with).with(%[expected: <= 3,\ngot : 4], 3, 4) 4.should <= 3 end Index: rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html =================================================================== --- rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html (revision 2153) +++ rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html (working copy) @@ -254,7 +254,8 @@ <dd class="spec failed"> <span class="failed_spec_name">should print diff of different strings</span> <div class="failure" id="failure_5"> - <div class="message"><pre>expected "RSpec is a\nbehaviour driven development\nframework for Ruby\n", got "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) + <div class="message"><pre>expected: "RSpec is a\nbehaviour driven development\nframework for Ruby\n", +got : "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) Diff: @@ -1,4 +1,4 @@ RSpec is a Index: rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html =================================================================== --- rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html (revision 2153) +++ rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html (working copy) @@ -258,7 +258,8 @@ <dd class="spec failed"> <span class="failed_spec_name">should print diff of different strings</span> <div class="failure" id="failure_5"> - <div class="message"><pre>expected "RSpec is a\nbehaviour driven development\nframework for Ruby\n", got "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) + <div class="message"><pre>expected: "RSpec is a\nbehaviour driven development\nframework for Ruby\n", +got : "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) Diff: @@ -1,4 +1,4 @@ RSpec is a Index: rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html =================================================================== --- rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html (revision 2153) +++ rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html (working copy) @@ -258,7 +258,8 @@ <dd class="spec failed"> <span class="failed_spec_name">should print diff of different strings</span> <div class="failure" id="failure_5"> - <div class="message"><pre>expected "RSpec is a\nbehaviour driven development\nframework for Ruby\n", got "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) + <div class="message"><pre>expected: "RSpec is a\nbehaviour driven development\nframework for Ruby\n", +got : "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) Diff: @@ -1,4 +1,4 @@ RSpec is a Index: rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html =================================================================== --- rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html (revision 2153) +++ rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html (working copy) @@ -260,7 +260,8 @@ <dd class="spec failed"> <span class="failed_spec_name">should print diff of different strings</span> <div class="failure" id="failure_5"> - <div class="message"><pre>expected "RSpec is a\nbehaviour driven development\nframework for Ruby\n", got "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) + <div class="message"><pre>expected: "RSpec is a\nbehaviour driven development\nframework for Ruby\n", +got : "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==) Diff: @@ -1,4 +1,4 @@ RSpec is a
From the Design Piracy series on my blog: