Sha256: d0c1881eb06ab2b927940678f8d4ace1de38f3c7800677e19d433de1bb750d8d
Contents?: true
Size: 1.09 KB
Versions: 12
Compression:
Stored size: 1.09 KB
Contents
require 'assert' require 'sanford-protocol/test/helpers' module Sanford::Protocol::Test::Helpers class BaseTests < Assert::Context desc "the test helpers" subject { Sanford::Protocol::Test::Helpers } should have_imeths :fake_socket_with_request, :fake_socket_with_msg_body should have_imeths :fake_socket_with_encoded_msg_body, :fake_socket_with should have_imeths :read_response_from_fake_socket should have_imeths :read_written_response_from_fake_socket should "be able to read responses given a fake socket" do setup_some_response_data fs = FakeSocket.new(@msg) response = subject.read_response_from_fake_socket(fs) assert_kind_of Sanford::Protocol::Response, response assert_equal @data, response.to_hash end should "be able to read responses written to a fake socket" do setup_some_response_data fs = FakeSocket.new; fs.send(@msg, 0) response = subject.read_written_response_from_fake_socket(fs) assert_kind_of Sanford::Protocol::Response, response assert_equal @data, response.to_hash end end end
Version data entries
12 entries across 12 versions & 1 rubygems