Skip to content

Commit 4181903

Browse files
committed
Test that an integer is equal to a float
1 parent 8d2ab95 commit 4181903

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spec/unit/differ_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@
22

33
RSpec.describe SuperDiff::Differ do
44
describe "#call" do
5-
context "given the same number" do
5+
context "given the same integers" do
66
it "returns an empty string" do
77
output = described_class.call(expected: 1, actual: 1)
88

99
expect(output).to eq("")
1010
end
1111
end
1212

13+
context "given the same numbers (even if they're different types)" do
14+
it "returns an empty string" do
15+
output = described_class.call(expected: 1, actual: 1.0)
16+
17+
expect(output).to eq("")
18+
end
19+
end
20+
1321
context "given differing numbers" do
1422
it "returns a message along with a comparison" do
1523
actual_output = described_class.call(expected: 42, actual: 1)

0 commit comments

Comments
 (0)