Sha256: 632522b176f38519e9e67c80dee2d9471de1bccb65566d93575ff8ad54f3a643

Contents?: true

Size: 556 Bytes

Versions: 55

Compression:

Stored size: 556 Bytes

Contents

# :coding: utf-8
require "helper"

class UnitTestEncoding < Loofah::TestCase
  UTF8_STRING = "日本語"

  if String.new.respond_to?(:encoding)
    describe "scrub_fragment" do
      it "sets the encoding for html" do
        escaped = Loofah.scrub_fragment(UTF8_STRING, :escape).to_s
        assert_equal UTF8_STRING.encoding, escaped.encoding
      end

      it "sets the encoding for xml" do
        escaped = Loofah.scrub_xml_fragment(UTF8_STRING, :escape).to_s
        assert_equal UTF8_STRING.encoding, escaped.encoding
      end
    end
  end
end

Version data entries

55 entries across 47 versions & 14 rubygems

Version Path
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/loofah-2.4.0/test/unit/test_encoding.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/loofah-2.4.0/test/unit/test_encoding.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/loofah-2.4.0/test/unit/test_encoding.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/loofah-2.3.1/test/unit/test_encoding.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/loofah-2.3.0/test/unit/test_encoding.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/loofah-2.2.3/test/unit/test_encoding.rb
loofah-2.4.0 test/unit/test_encoding.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/loofah-2.3.1/test/unit/test_encoding.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/loofah-2.3.0/test/unit/test_encoding.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/loofah-2.2.3/test/unit/test_encoding.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/loofah-2.3.1/test/unit/test_encoding.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/loofah-2.3.1/test/unit/test_encoding.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/loofah-2.3.0/test/unit/test_encoding.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/loofah-2.2.3/test/unit/test_encoding.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/loofah-2.3.1/test/unit/test_encoding.rb
loofah-2.3.1 test/unit/test_encoding.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/loofah-2.2.3/test/unit/test_encoding.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/loofah-2.3.0/test/unit/test_encoding.rb
loofah-2.3.0 test/unit/test_encoding.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/loofah-2.2.3/test/unit/test_encoding.rb