Sha256: 036143b1366b2b6e6f16bbb96e4b0991da9a1630c26e3c9f54c940d2ff117e9a

Contents?: true

Size: 769 Bytes

Versions: 6

Compression:

Stored size: 769 Bytes

Contents

# 100% shorthand
module CodepointTestHelper
  def assert_equal_encoded(expected, encode_mes)
    # Killing a duck because Ruby 1.9 doesn't mix Enumerable into String
    encode_mes = [encode_mes] if encode_mes.is_a?(String)
    encode_mes.each do |encode_me|
      encoded = encode(encode_me)
      actual = encoded.to_ascii
      if expected == actual
        # Let's not retest it
        assert true
      else
        message = "<#{expected.inspect}> expected but was\n<#{actual.inspect}>\n"
        message << "  defined in #{Unidecoder.in_yaml_file(encoded)}"
        fail message
      end
    end
  end

private
  def encode(codepoint)
    Unidecoder.encode(codepoint)
  end

  def which_yaml(codepoint)
    Unidecoder.in_yaml_file(encode(codepoint))
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
talentbox-unidecoder-2.0.0 test/unicode_point_suite/codepoint_test_helper.rb
unidecoder-1.1.2 test/unicode_point_suite/codepoint_test_helper.rb
blackwinter-unidecoder-1.1.1.1 test/unicode_point_suite/codepoint_test_helper.rb
talentbox-unidecoder-1.1.2 test/unicode_point_suite/codepoint_test_helper.rb
unidecoder-1.1.1 test/unicode_point_suite/codepoint_test_helper.rb
unidecoder-1.1.0 test/unicode_point_suite/codepoint_test_helper.rb