Sha256: 2c35eddf71ab7f5ab59d876bfdb2968c7c479a711691ab78d69e6edc82270fcb

Contents?: true

Size: 439 Bytes

Versions: 1

Compression:

Stored size: 439 Bytes

Contents

require 'test/unit'
require File.dirname(__FILE__) + "/../../lib/bencode.rb"

class BdecodeDictionaryTest < Test::Unit::TestCase
  def test_empty
    assert_equal Hash.new, "de".bdecode
  end

  def test_single_pair
    assert_equal({"a" => 42}, 'd1:ai42ee'.bdecode)
  end

  def test_multi_pair
    hsh = {"a" => "monkey", "h" => "elephant", "z" => "zebra"}
    assert_equal hsh, "d1:a6:monkey1:h8:elephant1:z5:zebrae".bdecode
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bencode-0.5.0 test/decode/test_dictionary.rb