Sha256: 605ae91b857ef8fd4fc108e5da72dbef771bc0489dba49b444add13ea197bc49

Contents?: true

Size: 531 Bytes

Versions: 4

Compression:

Stored size: 531 Bytes

Contents

require 'spec_helper'

describe Reel::Response do
  it "streams enumerables" do
    with_socket_pair do |client, connection|
      client << ExampleRequest.new.to_s
      request = connection.request

      connection.respond Reel::Response.new(:ok, ["Hello", "World"])
      connection.close

      response = client.read(4096)
      crlf = Reel::Response::Writer::CRLF
      fixture = "5#{crlf}Hello#{crlf}5#{crlf}World#{crlf}0#{crlf*2}"
      response[(response.length - fixture.length)..-1].should eq fixture
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reel-0.4.0.pre5 spec/reel/response_spec.rb
reel-0.4.0.pre4 spec/reel/response_spec.rb
reel-0.4.0.pre3 spec/reel/response_spec.rb
reel-0.4.0.pre2 spec/reel/response_spec.rb