Skip to content

Commit 27f3625

Browse files
committed
Fixed bug rendering no diff indicator as JSON
1 parent 47fd2d2 commit 27f3625

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.rspec

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
--color
22
--format documentation
3+
--require spec_helper

lib/pact/matchers/no_diff_indicator.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Matchers
33
class NoDiffIndicator
44

55
def to_json options = {}
6-
to_s
6+
to_s.inspect
77
end
88

99
def to_s
@@ -15,4 +15,4 @@ def == other
1515
end
1616
end
1717
end
18-
end
18+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'pact/matchers/no_diff_indicator'
2+
3+
module Pact
4+
module Matchers
5+
describe NoDiffIndicator do
6+
7+
describe "#to_json" do
8+
it "returns a json string" do
9+
expect(NoDiffIndicator.new.to_json).to eq '"no difference here!"'
10+
end
11+
end
12+
13+
end
14+
end
15+
end

0 commit comments

Comments
 (0)