Sha256: 4f57312353682f0a936e3e4f45d2c18c156c590d66eb1e563a83769571116667

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

require File.expand_path("../helper", __FILE__)

class HtmlEscapeTest < Minitest::Test
  include EscapeUtils::HtmlSafety

  def test_marks_escaped_strings_safe
    escaped = _escape_html("<strong>unsafe</strong>")
    assert_equal "&lt;strong&gt;unsafe&lt;/strong&gt;", escaped
    assert escaped.html_safe?
  end

  def test_doesnt_escape_safe_strings
    assert_equal "<p>safe string</p>", _escape_html("<p>safe string</p>".html_safe)
  end

  def test_
    assert_equal "5", _escape_html(5)
    assert_equal "hello", _escape_html(:hello)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
escape_utils-1.3.0 test/html_safety_test.rb