Sha256: 08278c21c5375878981a7ed0904f25339246af04b0fd4e27a062d947bddaf0df

Contents?: true

Size: 659 Bytes

Versions: 7

Compression:

Stored size: 659 Bytes

Contents

# encoding: UTF-8
$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'test/unit'
require 'htmlentities'

$KCODE = 'u' unless "1.9".respond_to?(:encoding)

class HTML4Test < Test::Unit::TestCase

  attr_reader :html_entities

  def setup
    @html_entities = HTMLEntities.new('html4')
  end

  # Found by Marcos Kuhns
  def test_should_not_encode_apos_entity
    assert_equal "'", html_entities.encode("'", :basic)
  end

  def test_should_not_decode_apos_entity
    assert_equal "é&apos;", html_entities.decode("&eacute;&apos;")
  end

  def test_should_not_decode_dotted_entity
    assert_equal "&b.Theta;", html_entities.decode("&b.Theta;")
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
htmlentities-4.2.4 test/html4_test.rb
htmlentities-4.2.3 test/html4_test.rb
htmlentities-4.2.2 test/html4_test.rb
htmlentitties-4.2.1 test/html4_test.rb
htmlentities-4.2.1 test/html4_test.rb
htmlentities-4.2.0 test/html4_test.rb
htmlentities-4.1.0 test/html4_test.rb