tests/ezmq/pair.rb in ezmq-0.4.2 vs tests/ezmq/pair.rb in ezmq-0.4.3
- old
+ new
@@ -15,9 +15,15 @@
should 'return the contents of messages they receive' do
@connected.send 'message'
assert_equal 'message', @bound.receive
end
+ should 'pass Hash messages to the encode method' do
+ @connected.encode = -> m { assert_equal({message: 'test'}, m) }
+ @connected.send message: 'test'
+ @connected.encode = -> m { m }
+ end
+
should 'yield the contents of messages they receive, if given a block' do
@bound.send 'message'
assert_equal 'message', @connected.receive { |m| m }
end