# test_entities.rb # 12. April 2007 # $:.unshift File.join(File.dirname(__FILE__),'..','lib') begin require "rubygems" require "clothred" rescue LoadError require "clothred" end require 'test/unit' class TestClothRedEntities < Test::Unit::TestCase ENTITIES_TEST = [ ["“", '"'], ["”", '"'], ["—", "--"], ["—", "--"], ["–","-"], ["…", "..."], ["×", " x "], ["™","(tm)"], ["®","(R)"], ["©","(c)"], ["’", "'"] ] def test_entities ENTITIES_TEST.each do |html, textile| test_html = ClothRed.new(html) result = test_html.to_textile assert_equal(textile,result) end end end