Sha256: c2f3145d8f8a6173c1f381584802d5dfe2f010272f22207700f0d4aca06b5fc5

Contents?: true

Size: 472 Bytes

Versions: 1

Compression:

Stored size: 472 Bytes

Contents

require 'environment'

class DecodingTest < MiniTest::Unit::TestCase
  context "The BEncode decoder" do
    should_decode 42, "i42e"
    should_decode 0, "i0e"
    should_decode -42, "i-42e"

    should_decode "foo", "3:foo"
    should_decode "", "0:"

    should_decode [1, 2, 3], "li1ei2ei3ee"
    
    hsh = {"foo" => "bar", "baz" => "qux"}
    should_decode hsh, "d3:foo3:bar3:baz3:quxe"
    
    should_decode 42, "i42eBOGUS", :ignore_trailing_junk => true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bencode-0.8.0 test/decoding_test.rb