Skip to content

Commit

Permalink
style: whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Mar 25, 2020
1 parent c4f79f4 commit 2a386d0
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions spec/lib/pact/matchers/matchers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ module Pact::Matchers
end

describe 'diffing' do

context "when expected is longer than the actual" do
subject { [1, 2, 3] }
let(:actual) { [1, 2] }
Expand Down Expand Up @@ -289,19 +288,15 @@ module Pact::Matchers
end

context 'where an expected value is a non-empty string' do

subject { {:a => 'a', :b => 'b'} }

context 'and the actual value is an empty string' do

let(:actual) { {:a => 'a', :b => ''} }

it 'includes this in the diff' do
expect(diff(subject, actual)).to eq({:b => Difference.new('b', '')})
end

end

end

context "when the expected value is a hash" do
Expand Down Expand Up @@ -331,20 +326,23 @@ module Pact::Matchers
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is an number" do
let(:actual) { 1 }
let(:difference) { Difference.new({a: "b"}, 1) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is a string" do
let(:actual) { "Thing" }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is the same" do
let (:actual) { {a: 'b'} }
it "should return an empty hash" do
Expand All @@ -362,27 +360,31 @@ module Pact::Matchers
expect(diff(subject, actual)).to eq difference
end
end

context "when the actual value is an hash" do
let(:actual) { {b: 'c'} }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is an number" do
let(:actual) { 1 }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is a string" do
let(:actual) { "Thing" }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is the same" do
let (:actual) { [1] }
it "should return an empty hash" do
Expand All @@ -393,34 +395,39 @@ module Pact::Matchers

context "when the expected value is a string" do
subject { "Thing"}

context "when the actual value is an array" do
let(:actual) { [2] }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is an hash" do
let(:actual) { {b: 'c'} }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is an number" do
let(:actual) { 1 }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is a string" do
let(:actual) { "Another Thing" }
let(:difference) { Difference.new(subject, actual) }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is the same" do
let (:actual) { "Thing" }
it "should return an empty hash" do
Expand All @@ -438,24 +445,28 @@ module Pact::Matchers
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is an hash" do
let(:actual) { {b: 'c'} }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is an number" do
let(:actual) { 2 }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is a string" do
let(:actual) { "Another Thing" }
it "should return the diff" do
expect(diff(subject, actual)).to eq(difference)
end
end

context "when the actual value is the same" do
let (:actual) { 1 }
it "should return an empty hash" do
Expand Down Expand Up @@ -554,8 +565,6 @@ module Pact::Matchers
expect(diff(subject, actual)).to eq({})
end
end

end

end
end
end

0 comments on commit 2a386d0

Please sign in to comment.