Permalink
Browse files

fixing test

  • Loading branch information...
1 parent 4c42bd9 commit 72ca2241926804944f330d1f281a2d6182f033d5 @tenderlove committed Aug 5, 2013
Showing with 4 additions and 3 deletions.
  1. +3 −2 lib/sphero/request.rb
  2. +1 −1 test/test_sphero.rb
@@ -23,10 +23,11 @@ def to_str
def response header, body
name = self.class.name.split('::').last
klass = if Response.const_defined?(name)
- Response.const_get(name).new header, body
+ Response.const_get(name)
else
- Response.new header, body
+ Response
end
+ klass.new header, body
end
def packet_header
View
@@ -4,7 +4,7 @@
class TestSphero < MiniTest::Unit::TestCase
def test_ping_checksum
ping = Sphero::Request::Ping.new 0
- assert_equal "\xFF\xFF\x00\x01\x00\x01\xFD", ping.to_str
+ assert_equal "\xFF\xFF\x00\x01\x00\x01\xFD".bytes, ping.to_str.bytes
end
def test_sleep_dlen

0 comments on commit 72ca224

Please sign in to comment.