mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Explode method expansion
Somewhere along the way the block argument gets dropped. Even though `method` is a `Def` that accepts a block, the `&block` portion is dropped. Possible Crystal compiler bug.
This commit is contained in:
parent
15dd2ea6f1
commit
17e97cb39a
2 changed files with 29 additions and 4 deletions
|
@ -5,7 +5,7 @@ Spectator.describe Spectator::Double do
|
|||
Spectator::Double.define(FooBarDouble, "dbl-name", foo: 42, bar: "baz")
|
||||
|
||||
# The subject `dbl` must be carefully used in sub-contexts, otherwise it pollutes parent scopes.
|
||||
# This changes the type of `dbl` to `Double`, which produces a union of methods and their return types.
|
||||
# This changes the type of `dbl` to `Double+`, which produces a union of methods and their return types.
|
||||
context "plain double" do
|
||||
subject(dbl) { FooBarDouble.new }
|
||||
|
||||
|
@ -38,6 +38,10 @@ Spectator.describe Spectator::Double do
|
|||
it "uses nil for undefined messages" do
|
||||
expect { dbl.baz }.to compile_as(Nil)
|
||||
end
|
||||
|
||||
it "supports blocks" do
|
||||
dbl.bar
|
||||
end
|
||||
end
|
||||
|
||||
context "without a double name" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue