From ce254c83be3cf613a8f655f55f2207073404148f Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Thu, 9 Mar 2023 00:49:16 +1300 Subject: Rewrite Assert to use blocks --- spec/parcom_spec.cr | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'spec/parcom_spec.cr') diff --git a/spec/parcom_spec.cr b/spec/parcom_spec.cr index 00c59a0..346e61b 100644 --- a/spec/parcom_spec.cr +++ b/spec/parcom_spec.cr @@ -163,11 +163,14 @@ end describe Assert do test_f = ->(x : Char) { x == 't' } - p = Assert.new(AnyToken(Char).new, test_f) + #p_proc = Assert.new(AnyToken(Char).new, test_f) + p = AnyToken(Char).new.assert { |x| x == 't' } describe "#parse" do it "fails if the wrapped parser fails" do - expect_raises(ParserException) { p.parse(TokenStream.new([] of Char)) } + expect_raises(ParserException) do + p.parse(TokenStream.new([] of Char)) + end end it "fails if the result value fails the test" do -- cgit v1.2.1