mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Merge branch 'super-inside-let-subject' into 'master'
Rework let and subject to allow super See merge request arctic-fox/spectator!22
This commit is contained in:
commit
557d7d431a
3 changed files with 7 additions and 7 deletions
|
@ -1,12 +1,12 @@
|
||||||
name: spectator
|
name: spectator
|
||||||
version: 0.8.3
|
version: 0.8.4
|
||||||
description: |
|
description: |
|
||||||
A feature-rich spec testing framework for Crystal with similarities to RSpec.
|
A feature-rich spec testing framework for Crystal with similarities to RSpec.
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Michael Miller <icy.arctic.fox@gmail.com>
|
- Michael Miller <icy.arctic.fox@gmail.com>
|
||||||
|
|
||||||
crystal: 0.31.0
|
crystal: 0.31.1
|
||||||
|
|
||||||
license: MIT
|
license: MIT
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Spectator
|
||||||
extend self
|
extend self
|
||||||
|
|
||||||
# Current version of the Spectator library.
|
# Current version of the Spectator library.
|
||||||
VERSION = "0.8.2"
|
VERSION = "0.8.4"
|
||||||
|
|
||||||
# Top-level describe method.
|
# Top-level describe method.
|
||||||
# All specs in a file must be wrapped in this call.
|
# All specs in a file must be wrapped in this call.
|
||||||
|
|
|
@ -897,7 +897,7 @@ module Spectator::DSL
|
||||||
# Block variant.
|
# Block variant.
|
||||||
|
|
||||||
# Create a block that returns the value.
|
# Create a block that returns the value.
|
||||||
let!(%value) {{block}}
|
let!({{name.id}}) {{block}}
|
||||||
|
|
||||||
# Wrapper to hold the value.
|
# Wrapper to hold the value.
|
||||||
# This will be nil if the value hasn't been referenced yet.
|
# This will be nil if the value hasn't been referenced yet.
|
||||||
|
@ -913,12 +913,12 @@ module Spectator::DSL
|
||||||
# Unwrap it from the wrapper variable.
|
# Unwrap it from the wrapper variable.
|
||||||
# Here we use typeof to get around the issue
|
# Here we use typeof to get around the issue
|
||||||
# that the macro has no idea what type the value is.
|
# that the macro has no idea what type the value is.
|
||||||
wrapper.unsafe_as(::Spectator::Internals::TypedValueWrapper(typeof(%value))).value
|
wrapper.unsafe_as(::Spectator::Internals::TypedValueWrapper(typeof(previous_def))).value
|
||||||
else
|
else
|
||||||
# The value isn't cached,
|
# The value isn't cached,
|
||||||
# Construct it and store it in the wrapper.
|
# Construct it and store it in the wrapper.
|
||||||
%value.tap do |value|
|
previous_def.tap do |value|
|
||||||
@%wrapper = ::Spectator::Internals::TypedValueWrapper(typeof(%value)).new(value)
|
@%wrapper = ::Spectator::Internals::TypedValueWrapper(typeof(previous_def)).new(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue