diff options
Diffstat (limited to 'spec/ruby/library/cgi/unescapeHTML_spec.rb')
| -rw-r--r-- | spec/ruby/library/cgi/unescapeHTML_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/ruby/library/cgi/unescapeHTML_spec.rb b/spec/ruby/library/cgi/unescapeHTML_spec.rb index 611ce0a6f1..e43dcc83e5 100644 --- a/spec/ruby/library/cgi/unescapeHTML_spec.rb +++ b/spec/ruby/library/cgi/unescapeHTML_spec.rb @@ -1,5 +1,9 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'cgi' +require_relative '../../spec_helper' +begin + require 'cgi/escape' +rescue LoadError + require 'cgi' +end describe "CGI.unescapeHTML" do it "unescapes '& < > "' to '& < > \"'" do @@ -36,4 +40,9 @@ describe "CGI.unescapeHTML" do input = "fooooooo&#" CGI.unescapeHTML(input).should == input end + + it "unescapes invalid encoding" do + input = "\xFF&" + CGI.unescapeHTML(input).should == input + end end |
