diff --git a/src/spectator/dsl/example_dsl.cr b/src/spectator/dsl/example_dsl.cr index c13402d..f39e4c9 100644 --- a/src/spectator/dsl/example_dsl.cr +++ b/src/spectator/dsl/example_dsl.cr @@ -11,5 +11,14 @@ module Spectator::DSL macro expect(actual) ::Spectator::Expectations::ValueExpectationPartial.new({{actual.stringify}}, {{actual}}) end + + def fail(reason : String) + raise ExampleFailed.new(reason) + end + + @[AlwaysInline] + def fail + fail("Example failed") + end end end