From 27a2d4281c5b270d6f3bba06ff1fd82ebfb94df6 Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Thu, 9 Mar 2023 01:13:08 +1300 Subject: Rewrite Satisfy to use blocks --- spec/parcom_spec.cr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'spec/parcom_spec.cr') diff --git a/spec/parcom_spec.cr b/spec/parcom_spec.cr index bdf8b5b..5be59b9 100644 --- a/spec/parcom_spec.cr +++ b/spec/parcom_spec.cr @@ -190,8 +190,7 @@ describe Assert do end describe Satisfy do - test_f = ->(x : Char) { x == 't' } - p = Satisfy.new(test_f) + p = Satisfy(Char).new { |x| x == 't' } describe "#parse" do it "fails if the input is empty" do @@ -210,7 +209,6 @@ describe Satisfy do result = p.parse(tokens) result.value.should eq(expected_char) - test_f.call(result.value).should be_true end end end -- cgit v1.2.1