diff options
Diffstat (limited to 'spec/ruby/library/stringscanner/check_spec.rb')
-rw-r--r-- | spec/ruby/library/stringscanner/check_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/library/stringscanner/check_spec.rb b/spec/ruby/library/stringscanner/check_spec.rb index c7f788f0b3..21da785515 100644 --- a/spec/ruby/library/stringscanner/check_spec.rb +++ b/spec/ruby/library/stringscanner/check_spec.rb @@ -13,4 +13,15 @@ describe "StringScanner#check" do @s.check(/is/).should == nil @s.matched.should == nil end + + ruby_version_is "2.7" do + it "treats String as the pattern itself" do + @s.check("This").should == "This" + @s.matched.should == "This" + @s.pos.should == 0 + @s.check(/is/).should == nil + @s.matched.should == nil + end + end + end |