mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move example-specific DSL to its own module
This commit is contained in:
parent
4bfd2b9620
commit
700108f52f
3 changed files with 8 additions and 4 deletions
|
@ -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? %}
|
||||
|
|
|
@ -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
|
||||
|
|
7
src/spectator/example_dsl.cr
Normal file
7
src/spectator/example_dsl.cr
Normal file
|
@ -0,0 +1,7 @@
|
|||
module Spectator
|
||||
module ExampleDSL
|
||||
macro is_expected
|
||||
expect(subject)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue