spec/fossyl_spec.rb in fossyl-0.5.1 vs spec/fossyl_spec.rb in fossyl-0.6.0
- old
+ new
@@ -1,12 +1,12 @@
require "minitest/spec"
require "minitest/autorun"
require "fossyl"
describe Fossyl do
- it "encodes strings" do
- Fossyl.dump("Fossyl").must_equal("6:Fossyl")
+ it "encodes bytes" do
+ Fossyl.dump("Fossyl\x9B").must_equal("7:Fossyl\x9B")
end
it "encodes integers" do
Fossyl.dump(12).must_equal("i12e")
Fossyl.dump(-12).must_equal("i-12e")
@@ -20,11 +20,11 @@
it "encodes dictionaries" do
Fossyl.dump(string: "Fossyl", integer: -12, list: [0, 12]).must_equal("d7:integeri-12e4:listli0ei12ee6:string6:Fossyle")
end
- it "decodes strings" do
- Fossyl.load("6:Fossyl").must_equal("Fossyl")
+ it "decodes bytes" do
+ Fossyl.load("7:Fossyl\x9B").must_equal("Fossyl\x9B".b)
end
it "decodes integers" do
Fossyl.load("i12e").must_equal(12)
Fossyl.load("i-12e").must_equal(-12)