Include ExampleDSL at root

Will need to check if methods can run in that scope.
This commit is contained in:
Michael Miller 2019-08-30 13:14:48 -06:00
parent 64045171c2
commit 4ecc2c6004
2 changed files with 2 additions and 6 deletions

View file

@ -38,8 +38,8 @@ module Spectator
# Root-level class that contains all examples and example groups.
class SpectatorExamples
# Include the DSL for creating groups, example, and more.
include ::Spectator::DSL::StructureDSL
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.
# Placeholder initializer.
# This is needed because examples and groups call super in their initializer.

View file

@ -241,7 +241,6 @@ module Spectator::DSL
# Class for the context.
# The class uses a generated unique name.
class Context%context < {{@type.id}}
# Check if `what` looks like a type.
# If it is, add the `#described_class` and `subject` methods.
# At the time of writing this code,
@ -1577,9 +1576,6 @@ module Spectator::DSL
private macro _spectator_test(class_name, run_method_name)
# Wrapper class for isolating the test code.
class {{class_name.id}} < {{@type.id}}
# Mix in methods and macros specifically for example DSL.
include ::Spectator::DSL::ExampleDSL
# Initializer that accepts sample values.
# The sample values are passed upward to the group modules.
# Any module that adds sample values can pull their values from this instance.