Sha256: 8b4327957c778803bcb15e628019a45c88585b2e87c7e74a244c6f1cac379e5d
Contents?: true
Size: 1.53 KB
Versions: 2
Compression:
Stored size: 1.53 KB
Contents
# encoding: UTF-8 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb') describe EscapeUtils, "unescape_html" do it "should respond to unescape_html" do EscapeUtils.should respond_to(:unescape_html) end it "should unescape a basic html tag" do EscapeUtils.unescape_html("<some_tag/>").should eql("<some_tag/>") end it "should unescape double-quotes" do EscapeUtils.unescape_html("<some_tag some_attr="some value"/>").should eql("<some_tag some_attr=\"some value\"/>") end it "should unescape single-quotes" do EscapeUtils.unescape_html("<some_tag some_attr='some value'/>").should eql("<some_tag some_attr='some value'/>") end it "should unescape the & character" do EscapeUtils.unescape_html("<b>Bourbon & Branch</b>").should eql("<b>Bourbon & Branch</b>") end if RUBY_VERSION =~ /^1.9/ it "should default to utf-8 if Encoding.default_internal is nil" do Encoding.default_internal = nil EscapeUtils.unescape_html("<b>Bourbon & Branch</b>").encoding.should eql(Encoding.find('utf-8')) end it "should use Encoding.default_internal" do Encoding.default_internal = Encoding.find('utf-8') EscapeUtils.unescape_html("<b>Bourbon & Branch</b>").encoding.should eql(Encoding.default_internal) Encoding.default_internal = Encoding.find('us-ascii') EscapeUtils.unescape_html("<b>Bourbon & Branch</b>").encoding.should eql(Encoding.default_internal) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
escape_utils-0.1.4 | spec/html/unescape_spec.rb |
escape_utils-0.1.3 | spec/html/unescape_spec.rb |