Sha256: 8190aa4de1f0a10f433134aa6cbf459c7bf4c741523008c8e1bbbc3e645dca21
Contents?: true
Size: 888 Bytes
Versions: 11
Compression:
Stored size: 888 Bytes
Contents
require File.dirname(__FILE__) + '/../test_helper' class EscapeTest < Test::Unit::TestCase include Sinatra::Helpers::Html::Escape def test_h_should_escape_text assert_equal 'this & that', h('this & that') end def test_h_should_return_blank_for_empty_string assert_equal '', h('') end def test_h_should_return_blank_for_nil assert_equal '', h(nil) end def test_hbang_should_escape_text assert_equal 'this & that', h!('this & that') end def test_hbang_should_return_nbsp_for_empty_string assert_equal ' ', h!('') end def test_hbang_should_return_nbsp_for_nil assert_equal ' ', h!(nil) end def test_hbang_should_return_arbitrary_placeholder_for_empty_string assert_equal 'N/A', h!('', 'N/A') end def test_hbang_should_return_arbitrary_placeholder_for_nil assert_equal 'N/A', h!(nil, 'N/A') end end
Version data entries
11 entries across 11 versions & 3 rubygems