From 1ea06998e7a913ebd5b0d2d0529500db5e37ce44 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 15 Sep 2018 11:30:45 -0600 Subject: [PATCH] Move #expect from global namespace to example DSL --- src/spectator/dsl/example_dsl.cr | 4 ++++ src/spectator/expectation.cr | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spectator/dsl/example_dsl.cr b/src/spectator/dsl/example_dsl.cr index f5c7986..40a77b9 100644 --- a/src/spectator/dsl/example_dsl.cr +++ b/src/spectator/dsl/example_dsl.cr @@ -4,6 +4,10 @@ module Spectator macro is_expected expect(subject) end + + def expect(actual : T) forall T + ::Spectator::Expectation.new(actual) + end end end end diff --git a/src/spectator/expectation.cr b/src/spectator/expectation.cr index 51a74c3..f7e296d 100644 --- a/src/spectator/expectation.cr +++ b/src/spectator/expectation.cr @@ -1,9 +1,5 @@ require "./matchers/matcher" -def expect(actual : T) forall T - Spectator::Expectation.new(actual) -end - module Spectator class Expectation(T) getter actual : T