File: xhtml1_test.rb

package info (click to toggle)
ruby-htmlentities 4.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: ruby: 2,235; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 534 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# encoding: UTF-8
require_relative "./test_helper"

class HTMLEntities::XHTML1Test < Test::Unit::TestCase

  attr_reader :html_entities

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

  def test_should_encode_apos_entity
    assert_equal "&apos;", html_entities.encode("'", :basic)
  end

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

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

end