Sha256: 15b537fa1973e4c0167df9597363320c832404eb7be86040e7ae42456f9b8442

Contents?: true

Size: 968 Bytes

Versions: 22

Compression:

Stored size: 968 Bytes

Contents

require 'spec_helper'

RSpec.describe Examples::EntityLiterals, type: :integration do
  it_behaves_like 'a builder' do
    let(:expected_json) do
      {
        type: :object,
        required: [:one],
        properties: {
          one: {
            enum: [:string, :null]
          },
          two: {
            allOf: [
              { type: :integer, minimum: 1 },
              { type: :string }
            ]
          },
          three: {
            anyOf: [
              { type: :integer, minimum: 1 },
              { type: :null }
            ]
          },
          four: {
            not: {
              type: :null
            }
          },
          five: {
            oneOf: [
              { type: :string },
              { type: :number }
            ]
          }
        }
      }
    end
  end

  it 'should raise through missing methods' do
    expect {
      described_class.new.bad_example
    }.to raise_error NameError
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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