mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix issue with implicit vs. explicit subject
Addresses the issue pointed out in !25 There was a recent change that set a subject to the first argument of `describe` and `context`. This prevented an explicitly defined subject from being accessible in nested groups.
This commit is contained in:
parent
d2f0f52729
commit
13a0b9e2d3
2 changed files with 10 additions and 2 deletions
|
@ -24,11 +24,11 @@ module Spectator
|
|||
{{what}}
|
||||
end
|
||||
|
||||
def subject(*args)
|
||||
def _spectator_implicit_subject(*args)
|
||||
described_class.new(*args)
|
||||
end
|
||||
{% else %}
|
||||
def subject
|
||||
def _spectator_implicit_subject(*args)
|
||||
{{what}}
|
||||
end
|
||||
{% end %}
|
||||
|
|
|
@ -6,6 +6,14 @@ require "./spectator/dsl"
|
|||
class SpectatorTest
|
||||
include ::Spectator::DSL
|
||||
|
||||
def _spectator_implicit_subject
|
||||
nil
|
||||
end
|
||||
|
||||
def subject
|
||||
_spectator_implicit_subject
|
||||
end
|
||||
|
||||
def initialize(@spectator_test_values : ::Spectator::TestValues)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue