From 49b06f40af04f1bad0e6a129386311bd9f27a9a3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 5 Nov 2025 11:56:21 +0900 Subject: [PATCH] Use the exception class mentioned in the doc Instead of an undocumented constant. --- spec/ruby/library/stringscanner/unscan_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/ruby/library/stringscanner/unscan_spec.rb b/spec/ruby/library/stringscanner/unscan_spec.rb index df0ea43367..b7b4876b8a 100644 --- a/spec/ruby/library/stringscanner/unscan_spec.rb +++ b/spec/ruby/library/stringscanner/unscan_spec.rb @@ -21,8 +21,8 @@ describe "StringScanner#unscan" do @s.pos.should == pos end - it "raises a ScanError when the previous match had failed" do - -> { @s.unscan }.should raise_error(ScanError) - -> { @s.scan(/\d/); @s.unscan }.should raise_error(ScanError) + it "raises a StringScanner::Error when the previous match had failed" do + -> { @s.unscan }.should raise_error(StringScanner::Error) + -> { @s.scan(/\d/); @s.unscan }.should raise_error(StringScanner::Error) end end