Use the exception class mentioned in the doc

Instead of an undocumented constant.
This commit is contained in:
Nobuyoshi Nakada 2025-11-05 11:56:21 +09:00 committed by Nobuyoshi Nakada
parent 53f1fc2546
commit 49b06f40af
Notes: git 2025-11-05 04:53:51 +00:00

View File

@ -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