Skip to content

Commit

Permalink
Fix diffing spec on jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Phippen committed Oct 11, 2014
1 parent 5008f23 commit 2d7b8a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/rspec/mocks/diffing_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "spec_helper"
require "pp"

RSpec.describe "Diffs printed when arguments don't match" do
before do
Expand Down Expand Up @@ -128,11 +129,12 @@ def self.name
end.new

collab_inspect = collab.inspect
collab_pp = PP.pp(collab, "").strip

expect(d).to receive(:foo).with(collab)
expect {
d.foo([:a, :b])
}.to fail_with("Double \"double\" received :foo with unexpected arguments\n expected: (#{collab_inspect})\n got: ([:a, :b])\nDiff:\n@@ -1,2 +1,2 @@\n-[#{collab_inspect}]\n+[[:a, :b]]\n")
}.to fail_with("Double \"double\" received :foo with unexpected arguments\n expected: (#{collab_inspect})\n got: ([:a, :b])\nDiff:\n@@ -1,2 +1,2 @@\n-[#{collab_pp}]\n+[[:a, :b]]\n")
reset d
end
end
Expand Down

0 comments on commit 2d7b8a7

Please sign in to comment.