aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-09 01:13:08 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-09 01:13:08 +1300
commit27a2d4281c5b270d6f3bba06ff1fd82ebfb94df6 (patch)
tree79a391d3f13d3b6508d1cc746db488958edd13ed /spec
parent8f8bee2893df280bd013e06c338838c758c4d8fc (diff)
Rewrite Satisfy to use blocks
Diffstat (limited to 'spec')
-rw-r--r--spec/parcom_spec.cr4
1 files changed, 1 insertions, 3 deletions
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