Skip to content

Commit

Permalink
chore(test): remove duplicated tests and update expected msg
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Aug 15, 2024
1 parent 0656c98 commit 6231d0e
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions spec/lib/pact/matchers/matchers_messages_regexp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ module Pact::Matchers

context "when the Pact::Term does not match" do
it "returns a message" do
expect(difference[:thing].message).to eq "Expected a String matching /foo/ (like \"food\") but got \"drink\" at <path>"
expect(difference[:thing].message).to eq "Expected a Value matching /foo/ (like \"food\") but got \"drink\" at <path>"
end
end

context "when the actual is a numeric" do
let(:actual) { INT }
it "returns a message" do
expect(difference[:thing].message).to eq "Expected a Integer matching /foo/ (like \"food\") but got #{a_numeric} (1) at <path>"
expect(difference[:thing].message).to eq "Expected a Value matching /foo/ (like \"food\") but got #{a_numeric} (1) at <path>"
end
end

context "when the actual is a float" do
let(:actual) { FLOAT }
it "returns a message" do
expect(difference[:thing].message).to eq "Expected a Float matching /foo/ (like \"food\") but got #{a_float} (1.0) at <path>"
expect(difference[:thing].message).to eq "Expected a Value matching /foo/ (like \"food\") but got #{a_float} (1.0) at <path>"
end
end

Expand All @@ -52,20 +52,6 @@ module Pact::Matchers
end
end

context "when the actual is a numeric" do
let(:actual) { INT }
it "returns a message" do
expect(difference[:thing].message).to eq "Expected a Integer matching /foo/ (like \"food\") but got #{a_numeric} (1) at <path>"
end
end

context "when the actual is a float" do
let(:actual) { FLOAT }
it "returns a message" do
expect(difference[:thing].message).to eq "Expected a Float matching /foo/ (like \"food\") but got #{a_float} (1.0) at <path>"
end
end

context "when the actual is nil" do
let(:actual) { nil }
it "returns a message" do
Expand Down

0 comments on commit 6231d0e

Please sign in to comment.