mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Change SpectatorTest to SpectatorContext
This commit is contained in:
parent
50bae36ab0
commit
8b205278ad
2 changed files with 2 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
|||
require "./spectator/includes"
|
||||
require "./spectator_test"
|
||||
require "./spectator_context"
|
||||
|
||||
# Module that contains all functionality related to Spectator.
|
||||
module Spectator
|
||||
|
@ -38,7 +38,7 @@ module Spectator
|
|||
# For more information on how the DSL works, see the `DSL` module.
|
||||
|
||||
# Root-level class that contains all examples and example groups.
|
||||
class SpectatorTest
|
||||
class SpectatorContext
|
||||
# Pass off the description argument and block to `DSL::StructureDSL.describe`.
|
||||
# That method will handle creating a new group for this spec.
|
||||
describe({{description}}) {{block}}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
require "./spectator/dsl"
|
||||
|
||||
# Root-level class that all tests inherit from and are contained in.
|
||||
# This class is intentionally outside of the scope of Spectator,
|
||||
# so that the namespace isn't leaked into tests unexpectedly.
|
||||
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
|
||||
|
||||
# Prevent leaking internal values since their types may differ.
|
||||
# Workaround for: https://gitlab.com/arctic-fox/spectator/-/issues/53
|
||||
def inspect(io)
|
||||
io << self.class
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue