diff options
Diffstat (limited to 'spec/ruby/library/stringscanner/exist_spec.rb')
-rw-r--r-- | spec/ruby/library/stringscanner/exist_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/library/stringscanner/exist_spec.rb b/spec/ruby/library/stringscanner/exist_spec.rb index beafadc07b..ff860a0d3e 100644 --- a/spec/ruby/library/stringscanner/exist_spec.rb +++ b/spec/ruby/library/stringscanner/exist_spec.rb @@ -21,4 +21,10 @@ describe "StringScanner#exist?" do @s.scan(/This is/) @s.exist?(/i/).should == nil end + + it "raises TypeError if given a String" do + -> { + @s.exist?('T') + }.should raise_error(TypeError, 'wrong argument type String (expected Regexp)') + end end |