Sha256: 426f8c8609fe59f68e48b5254ead919f92b5516a05b74331b67ba177ab547550
Contents?: true
Size: 887 Bytes
Versions: 1
Compression:
Stored size: 887 Bytes
Contents
describe Noam::Message::Marco do let(:marco) { described_class.new('test_room', 'Test Lemma') } let(:message) { ['message', 'room', 1234].to_json } let(:sockaddr) { [1, 2, 3, 4] } before do described_class.any_instance.stubs(:message_received?).returns(true) UDPSocket.any_instance.stubs(:send) UDPSocket.any_instance.stubs(:recvfrom).returns([message, sockaddr]) end it "sends a marco message to the server" do UDPSocket.any_instance.expects(:send).with( ["marco", 'Test Lemma', 'test_room', Noam::DEVICE_TYPE, Noam::VERSION].to_json, 0, '255.255.255.255', Noam::BEACON_PORT ) marco.start end it "returns a polo with the server's host" do polo = marco.start expect(polo.host).to eq(3) end it "returns a polo with the server's port" do polo = marco.start expect(polo.port).to eq(1234) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
noam_lemma-0.2.1.3 | spec/noam_lemma/message/marco_spec.rb |