Move example-specific DSL to its own module

This commit is contained in:
Michael Miller 2018-09-12 15:41:23 -06:00
parent 4bfd2b9620
commit 700108f52f
3 changed files with 8 additions and 4 deletions

View File

@ -168,6 +168,7 @@ module Spectator
{% given_vars = ::Spectator::ContextDefinitions::ALL[parent_module.id][:given] %}
{% var_names = given_vars.map { |v| v[:name] } %}
class {{class_name.id}} < ::Spectator::Example
include ExampleDSL
include Locals
{% if given_vars.empty? %}

View File

@ -7,10 +7,6 @@ module Spectator
def initialize(@context)
end
macro is_expected
expect(subject)
end
abstract def run : Nil
abstract def description : String
end

View File

@ -0,0 +1,7 @@
module Spectator
module ExampleDSL
macro is_expected
expect(subject)
end
end
end