Sha256: 9c02fa8d25f8674b41b92a71dbc477d17faa1e0be6a843c5c1b2f9dc33b31139

Contents?: true

Size: 833 Bytes

Versions: 18

Compression:

Stored size: 833 Bytes

Contents

require 'spec_helper'

describe Krikri::JsonParser do
  subject { Krikri::JsonParser.new(record) }
  let(:record) { build(:json_record) }

  it_behaves_like 'a parser'

  context 'with a root path that specifies an array' do
    subject { Krikri::JsonParser.new(record, '$.contributor') }
    it_behaves_like 'a parser'
  end

  context 'with a root path with that specifies a key in an array' do
    subject { Krikri::JsonParser.new(record, '$.contributor[0]') }
    it_behaves_like 'a parser'
  end

  context 'with a root path that specifies an object' do
    subject { Krikri::JsonParser.new(record, '$.translations') }
    it_behaves_like 'a parser'
  end
end

describe Krikri::JsonParser::Value do
  subject { Krikri::JsonParser.new(record).root }
  let(:record) { build(:json_record) }

  it_behaves_like 'a parser value'
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
krikri-0.5.7 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.5.6 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.5.5 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.5.4 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.5.3 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.5.2 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.5.1 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.5.0 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.4.0 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.3.3 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.3.2 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.3.1 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.2.1 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.2.0 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.1.3 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.1.2 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.1.1 spec/lib/krikri/parsers/json_parser_spec.rb
krikri-0.1.0 spec/lib/krikri/parsers/json_parser_spec.rb