Sha256: a02b72fca9b24dce40d46852b72ced853ea146898f9863b38dbb932ccdb8129b

Contents?: true

Size: 432 Bytes

Versions: 2

Compression:

Stored size: 432 Bytes

Contents

# encoding: utf-8

require 'helper'

class TestEightball < Test::Unit::TestCase

  should "return utf-8 when utf-8 is called" do
    assert_equal "ウabcé", "ウabcé".encode("utf-8")
  end

  should "remove invalid UTF-8 byte sequences" do
    string = File.read("test/files/test1")
    string = string.eightball
    assert !string.empty?
    assert string.valid_encoding?
    assert string.encoding == Encoding::UTF_8
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eightball-0.2.2 test/test_eightball.rb
eightball-0.2.1 test/test_eightball.rb