Sha256: 43f833a9dc9aa50d307c5fe5fc515a4dd8b1267c94f34f95734f9feb981f0c95

Contents?: true

Size: 387 Bytes

Versions: 8

Compression:

Stored size: 387 Bytes

Contents

RSpec.describe Redd::Response::ParseJson do
  it "parses valid JSON" do
    parsed = subject.parse('{"hello": "world", "foo": {"bar": 2}}')
    expect(parsed).to eq(hello: "world", foo: {bar: 2})
  end

  it "returns the JSON string if it's invalid" do
    error = "comparision with banana failed."
    parsed = subject.parse(error)
    expect(parsed).to eq(error)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
redd-0.7.7 spec/redd/response/parse_json_spec.rb
redd-0.7.6 spec/redd/response/parse_json_spec.rb
redd-0.7.5 spec/redd/response/parse_json_spec.rb
redd-0.7.4 spec/redd/response/parse_json_spec.rb
redd-0.7.3 spec/redd/response/parse_json_spec.rb
redd-0.7.2 spec/redd/response/parse_json_spec.rb
redd-0.7.1 spec/redd/response/parse_json_spec.rb
redd-0.7.0 spec/redd/response/parse_json_spec.rb