mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move matchers DSL into their own module
Moves the #eq method out of the global namespace.
This commit is contained in:
parent
1ea06998e7
commit
6ca4d8d2a6
3 changed files with 15 additions and 4 deletions
|
@ -1,6 +1,10 @@
|
|||
require "./matcher_dsl"
|
||||
|
||||
module Spectator
|
||||
module DSL
|
||||
module ExampleDSL
|
||||
include MatcherDSL
|
||||
|
||||
macro is_expected
|
||||
expect(subject)
|
||||
end
|
||||
|
|
11
src/spectator/dsl/matcher_dsl.cr
Normal file
11
src/spectator/dsl/matcher_dsl.cr
Normal file
|
@ -0,0 +1,11 @@
|
|||
require "../matchers"
|
||||
|
||||
module Spectator
|
||||
module DSL
|
||||
module MatcherDSL
|
||||
def eq(expected : T) forall T
|
||||
::Spectator::Matchers::EqualityMatcher(T).new(expected)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,9 +1,5 @@
|
|||
require "./matcher"
|
||||
|
||||
def eq(expected : T) forall T
|
||||
Spectator::Matchers::EqualityMatcher(T).new(expected)
|
||||
end
|
||||
|
||||
module Spectator
|
||||
module Matchers
|
||||
class EqualityMatcher(T) < Matcher
|
||||
|
|
Loading…
Reference in a new issue