File: response_fragment_spec.rb

package info (click to toggle)
ruby-httparty 0.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 964 kB
  • sloc: ruby: 7,521; xml: 425; sh: 35; makefile: 14
file content (17 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))

RSpec.describe HTTParty::ResponseFragment do
  it "access to fragment" do
    fragment = HTTParty::ResponseFragment.new("chunk", nil, nil)
    expect(fragment).to eq("chunk")
  end

  it "has access to delegators" do
    response = double(code: '200')
    connection = double
    fragment = HTTParty::ResponseFragment.new("chunk", response, connection)
    expect(fragment.code).to eq(200)
    expect(fragment.http_response).to eq response
    expect(fragment.connection).to eq connection
  end
end