Sha256: 26ace43270d38b26b599acf29c9f8a1c4d35837908fefbefac228c35c0fe1589

Contents?: true

Size: 557 Bytes

Versions: 8

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

require "spec_helpers"

describe Wayfarer::Parsing::JSON do
  subject(:parser) { Wayfarer::Parsing::JSON }

  describe ".parse" do
    it "returns a Hash" do
      json_str = <<-JSON
        {
          "id": 1,
          "name": "Foo",
          "price": 123,
          "tags": [
            "Bar",
            "Eek"
          ],
          "stock": {
            "warehouse": 300,
            "retail": 20
          }
        }
      JSON

      doc = parser.parse(json_str)

      expect(doc).to be_a Hash
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wayfarer-0.4.7 spec/parsing/json_spec.rb
wayfarer-0.4.6 spec/parsing/json_spec.rb
wayfarer-0.4.5 spec/parsing/json_spec.rb
wayfarer-0.4.4 spec/parsing/json_spec.rb
wayfarer-0.4.3 spec/parsing/json_spec.rb
wayfarer-0.4.2 spec/parsing/json_spec.rb
wayfarer-0.4.1 spec/parsing/json_spec.rb
wayfarer-0.4.0 spec/parsing/json_spec.rb