mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fixed an issue where named subjects could crash the compiler
Received: Nil assertion failed (NilAssertionError) from ??? ... Error: you've found a bug in the Crystal compiler. ... for this code: subject(point) { Point.new } describe "#x" do subject { point.x } end Redefining subjects with a named subject broke. This commit fixes that with a simply flip in the definitions.
This commit is contained in:
parent
ec9e598882
commit
01b5d71ad0
1 changed files with 2 additions and 2 deletions
|
@ -781,8 +781,8 @@ module Spectator::DSL
|
||||||
# It is cached so that the same instance is used throughout the test.
|
# It is cached so that the same instance is used throughout the test.
|
||||||
# The subject will be recreated for each test it is used in.
|
# The subject will be recreated for each test it is used in.
|
||||||
macro subject(name, &block)
|
macro subject(name, &block)
|
||||||
subject {{block}}
|
let({{name.id}}) {{block}}
|
||||||
let({{name.id}}) { subject }
|
subject { {{name.id}} }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Defines an expression by name.
|
# Defines an expression by name.
|
||||||
|
|
Loading…
Reference in a new issue