Sha256: 19a1c130521bbb78c46fdcd3d24c77a9cf8a8e6a284bc58584d61e741b9fcd05

Contents?: true

Size: 542 Bytes

Versions: 5

Compression:

Stored size: 542 Bytes

Contents

# :coding: utf-8
require "helper"

class UnitTestEncoding < Loofah::TestCase
  def setup
    @utf8_string = "日本語"
  end

  if String.new.respond_to?(:encoding)
    def test_html_fragment_string_sets_encoding
      escaped = Loofah.scrub_fragment(@utf8_string, :escape).to_s
      assert_equal @utf8_string.encoding, escaped.encoding
    end

    def test_xml_fragment_string_sets_encoding
      escaped = Loofah.scrub_xml_fragment(@utf8_string, :escape).to_s
      assert_equal @utf8_string.encoding, escaped.encoding
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
loofah-2.0.1 test/unit/test_encoding.rb
loofah-2.0.0 test/unit/test_encoding.rb
loofah-1.2.1 test/unit/test_encoding.rb
loofah-1.2.0 test/unit/test_encoding.rb
loofah-1.1.0 test/unit/test_encoding.rb