mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Prevent comparing range arguments with non-compatible types in stubs
Addresses https://github.com/icy-arctic-fox/spectator/issues/48
This commit is contained in:
parent
f55c60e01f
commit
e6584c9f04
4 changed files with 37 additions and 24 deletions
|
@ -38,6 +38,10 @@ Spectator.describe "GitHub Issue #48" do
|
|||
block.call(thing)
|
||||
block
|
||||
end
|
||||
|
||||
def range(r : Range)
|
||||
r
|
||||
end
|
||||
end
|
||||
|
||||
mock Test, make_nilable: nil
|
||||
|
@ -122,4 +126,10 @@ Spectator.describe "GitHub Issue #48" do
|
|||
allow(fake).to receive(:capture).and_return(proc)
|
||||
expect(fake.capture(5) { 5 }).to be(proc)
|
||||
end
|
||||
|
||||
it "handles range comparisons against non-comparable types" do
|
||||
range = 1..10
|
||||
allow(fake).to receive(:range).and_return(range)
|
||||
expect(fake.range(1..3)).to eq(range)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue