File: json_spec.rb

package info (click to toggle)
ruby-http 4.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 704 kB
  • sloc: ruby: 5,388; makefile: 9
file content (15 lines) | stat: -rw-r--r-- 341 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

RSpec.describe HTTP::Options, "json" do
  let(:opts) { HTTP::Options.new }

  it "defaults to nil" do
    expect(opts.json).to be nil
  end

  it "may be specified with with_json data" do
    opts2 = opts.with_json(:foo => 42)
    expect(opts.json).to be nil
    expect(opts2.json).to eq(:foo => 42)
  end
end