Sha256: 65fb0087c05dad02dc681e18311906c32345ab2bfdba6c1e8a71d3199074cd2f

Contents?: true

Size: 692 Bytes

Versions: 3

Compression:

Stored size: 692 Bytes

Contents

require "test/unit"
require "vcard"

include Vcard

class Test::Unit::TestCase
  # Test equivalence where whitespace is compressed.

  def assert_equal_nospace(expected, got)
    expected = expected.gsub(/\s+/,'')
    got = expected.gsub(/\s+/,'')
    assert_equal(expected, got)
  end

  def utf_name_test(c)
    card = Vcard::Vcard.decode(c).first
    assert_equal("name", card.name.family)
  rescue
    $!.message << " #{c.inspect}"
    raise
  end

  def be(s)
    s.unpack('U*').pack('n*')
  end

  def le(s)
    s.unpack('U*').pack('v*')
  end

  def vcard(name)
    open("test/fixtures/#{name}.vcard").read
  end

  def vcal(name)
    open("test/fixtures/#{name}.vcal").read
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vcard-0.2.2 test/test_helper.rb
vcard-0.2.1 test/test_helper.rb
vcard-0.2.0 test/test_helper.rb