mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Change test root to SpectatorTest
This commit is contained in:
parent
752b7f0ffa
commit
00a2495027
2 changed files with 13 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
require "./spectator/includes"
|
||||
require "./spectator_test"
|
||||
|
||||
# Module that contains all functionality related to Spectator.
|
||||
module Spectator
|
||||
|
@ -32,15 +33,12 @@ module Spectator
|
|||
# We don't want the spec code to accidentally pickup types and values from the `Spectator` module.
|
||||
# Another reason is that we need a root module to put all examples and groups in.
|
||||
# And lastly, the spec DSL needs to be given to the block of code somehow.
|
||||
# The DSL is included in the `SpectatorExamples` module.
|
||||
# The DSL is included in the `SpectatorTest` class.
|
||||
#
|
||||
# For more information on how the DSL works, see the `DSL` module.
|
||||
|
||||
# Root-level class that contains all examples and example groups.
|
||||
class SpectatorExamples
|
||||
include ::Spectator::DSL::StructureDSL # Include the DSL for creating groups, example, and more.
|
||||
include ::Spectator::DSL::ExampleDSL # Mix in methods and macros specifically for example DSL.
|
||||
|
||||
class SpectatorTest
|
||||
# Pass off the "what" argument and block to `DSL::StructureDSL.describe`.
|
||||
# That method will handle creating a new group for this spec.
|
||||
describe({{what}}) {{block}}
|
||||
|
|
10
src/spectator_test.cr
Normal file
10
src/spectator_test.cr
Normal file
|
@ -0,0 +1,10 @@
|
|||
require "./spectator/dsl/example_dsl"
|
||||
require "./spectator/dsl/structure_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::StructureDSL # Include the DSL for creating groups, example, and more.
|
||||
include ::Spectator::DSL::ExampleDSL # Mix in methods and macros specifically for example DSL.
|
||||
end
|
Loading…
Reference in a new issue