Change SpectatorTest to SpectatorContext

This commit is contained in:
Michael Miller 2020-09-12 15:57:20 -06:00
parent 50bae36ab0
commit 8b205278ad
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD
2 changed files with 2 additions and 27 deletions

View file

@ -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}}

View file

@ -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