Sha256: 49043bbe4b928b79b8b583af454eb4455ec18031df8f8d4d3670067ee484b8fa

Contents?: true

Size: 907 Bytes

Versions: 20

Compression:

Stored size: 907 Bytes

Contents

require 'spec_helper'

RSpec.describe Examples::Rooted, type: :integration do
  context 'with a root key' do
    it_behaves_like 'a builder' do
      let(:expected_json) do
        {
          type: :object,
          required: [:rooted],
          properties: {
            rooted: {
              type: :object,
              properties: {
                name: { type: :string }
              }
            }
          }
        }
      end
    end
  end

  context 'with an alternate root key' do
    it_behaves_like 'a builder' do
      let(:schema_method){ :alternate_root }
      let(:expected_json) do
        {
          type: :object,
          required: [:other_root],
          properties: {
            other_root: {
              type: :object,
              properties: {
                name: { type: :string }
              }
            }
          }
        }
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
json-schema_builder-0.8.2 spec/integration/rooted_spec.rb
json-schema_builder-0.8.1 spec/integration/rooted_spec.rb
json-schema_builder-0.8.0 spec/integration/rooted_spec.rb
json-schema_builder-0.7.1 spec/integration/rooted_spec.rb
json-schema_builder-0.7.0 spec/integration/rooted_spec.rb
json-schema_builder-0.6.1 spec/integration/rooted_spec.rb
json-schema_builder-0.6.0 spec/integration/rooted_spec.rb
json-schema_builder-0.5.0 spec/integration/rooted_spec.rb
json-schema_builder-0.4.0 spec/integration/rooted_spec.rb
json-schema_builder-0.3.1 spec/integration/rooted_spec.rb
json-schema_builder-0.3.0 spec/integration/rooted_spec.rb
json-schema_builder-0.2.1 spec/integration/rooted_spec.rb
json-schema_builder-0.2.0 spec/integration/rooted_spec.rb
json-schema_builder-0.1.0 spec/integration/rooted_spec.rb
json-schema_builder-0.0.9 spec/integration/rooted_spec.rb
json-schema_builder-0.0.8 spec/integration/rooted_spec.rb
json-schema_builder-0.0.7 spec/integration/rooted_spec.rb
json-schema_builder-0.0.6 spec/integration/rooted_spec.rb
json-schema_builder-0.0.5 spec/integration/rooted_spec.rb
json-schema_builder-0.0.4 spec/integration/rooted_spec.rb