Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MessagePackPure::Unpacker.readメソッドを削除

  • Loading branch information...
commit 8eb3c9d143e89bae52246f86580bb039b5cdb2ce 1 parent 15223a0
@nayutaya authored
View
3  lib/msgpack_pure/core.rb
@@ -14,6 +14,7 @@ def self.pack(value)
def self.unpack(binary)
io = StringIO.new(binary, "r")
- return Unpacker.read(io)
+ unpacker = Unpacker.new(io)
+ return unpacker.read
end
end
View
5 lib/msgpack_pure/unpacker.rb
@@ -15,11 +15,6 @@ def initialize(io)
attr_reader :io
- def self.read(io)
- unpacker = self.new(io)
- return unpacker.read
- end
-
def read
type = self.unpack_uint8
View
13 test/unpacker_test.rb
@@ -8,7 +8,6 @@
class UnpackerTest < Test::Unit::TestCase
def setup
@klass = MessagePackPure::Unpacker
- @module = MessagePackPure::Unpacker
end
def test_initialize
@@ -134,7 +133,7 @@ def test_read__fixarray
i
}
io.rewind
- assert_equal(array, @module.read(io))
+ assert_equal(array, @klass.new(io).read)
end
def test_read__array16
@@ -147,7 +146,7 @@ def test_read__array16
i
}
io.rewind
- assert_equal(array, @module.read(io))
+ assert_equal(array, @klass.new(io).read)
end
def test_read__array32
@@ -160,7 +159,7 @@ def test_read__array32
i
}
io.rewind
- assert_equal(array, @module.read(io))
+ assert_equal(array, @klass.new(io).read)
end
def test_read__fixmap
@@ -177,7 +176,7 @@ def test_read__fixmap
memo
}
io.rewind
- assert_equal(hash, @module.read(io))
+ assert_equal(hash, @klass.new(io).read)
end
def test_read__map16
@@ -194,7 +193,7 @@ def test_read__map16
memo
}
io.rewind
- assert_equal(hash, @module.read(io))
+ assert_equal(hash, @klass.new(io).read)
end
def test_read__map32
@@ -211,7 +210,7 @@ def test_read__map32
memo
}
io.rewind
- assert_equal(hash, @module.read(io))
+ assert_equal(hash, @klass.new(io).read)
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.