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
cf448576e2
commit
f825a34771
2 changed files with 10 additions and 2 deletions
|
@ -24,11 +24,11 @@ module Spectator
|
||||||
{{what}}
|
{{what}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def subject(*args)
|
def _spectator_implicit_subject(*args)
|
||||||
described_class.new(*args)
|
described_class.new(*args)
|
||||||
end
|
end
|
||||||
{% else %}
|
{% else %}
|
||||||
def subject
|
def _spectator_implicit_subject(*args)
|
||||||
{{what}}
|
{{what}}
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
|
@ -6,6 +6,14 @@ require "./spectator/dsl"
|
||||||
class SpectatorTest
|
class SpectatorTest
|
||||||
include ::Spectator::DSL
|
include ::Spectator::DSL
|
||||||
|
|
||||||
|
def _spectator_implicit_subject
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def subject
|
||||||
|
_spectator_implicit_subject
|
||||||
|
end
|
||||||
|
|
||||||
def initialize(@spectator_test_values : ::Spectator::TestValues)
|
def initialize(@spectator_test_values : ::Spectator::TestValues)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue