Move matchers DSL into their own module

Moves the #eq method out of the global namespace.
This commit is contained in:
Michael Miller 2018-09-15 11:58:43 -06:00
parent 1ea06998e7
commit 6ca4d8d2a6
3 changed files with 15 additions and 4 deletions

View file

@ -1,6 +1,10 @@
require "./matcher_dsl"
module Spectator
module DSL
module ExampleDSL
include MatcherDSL
macro is_expected
expect(subject)
end

View 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

View file

@ -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