File: parse_marshal_spec.rb

package info (click to toggle)
ruby-faraday-middleware 1.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 376 kB
  • sloc: ruby: 2,388; sh: 15; makefile: 6
file content (15 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

RSpec.describe FaradayMiddleware::ParseMarshal, type: :response do
  it 'restores a marshaled dump' do
    expect(process(Marshal.dump(a: 1)).body).to be_eql(a: 1)
  end

  it 'nulifies blank response' do
    expect(process('').body).to be_nil
  end

  it 'chokes on invalid content' do
    expect { process('abc') }.to raise_error(Faraday::ParsingError)
  end
end