|
1 | 1 | require 'environment' |
2 | 2 |
|
3 | | -class DecodingTest < MiniTest::Unit::TestCase |
4 | | - context "The BEncode decoder" do |
5 | | - should_decode 42, "i42e" |
6 | | - should_decode 0, "i0e" |
7 | | - should_decode -42, "i-42e" |
| 3 | +describe "decoding" do |
| 4 | + it_should_decode 42, "i42e" |
| 5 | + it_should_decode 0, "i0e" |
| 6 | + it_should_decode -42, "i-42e" |
8 | 7 |
|
9 | | - should_decode "foo", "3:foo" |
10 | | - should_decode "", "0:" |
| 8 | + it_should_decode "foo", "3:foo" |
| 9 | + it_should_decode "", "0:" |
11 | 10 |
|
12 | | - should_decode [1, 2, 3], "li1ei2ei3ee" |
13 | | - |
14 | | - hsh = {"foo" => "bar", "baz" => "qux"} |
15 | | - should_decode hsh, "d3:foo3:bar3:baz3:quxe" |
16 | | - |
17 | | - should_decode 42, "i42eBOGUS", :ignore_trailing_junk => true |
18 | | - end |
| 11 | + it_should_decode [1, 2, 3], "li1ei2ei3ee" |
| 12 | + |
| 13 | + hsh = {"foo" => "bar", "baz" => "qux"} |
| 14 | + it_should_decode hsh, "d3:foo3:bar3:baz3:quxe" |
| 15 | + |
| 16 | + it_should_decode 42, "i42eBOGUS", :ignore_trailing_junk => true |
19 | 17 | end |
0 commit comments