Sha256: 0514bbf8e8d06106bcb8f9e9b0a5723ea39746f36a66817a7eb8fee8cf209cd7

Contents?: true

Size: 735 Bytes

Versions: 20

Compression:

Stored size: 735 Bytes

Contents

require 'spec_helper'

describe GraphQL::BaseType do
  it 'becomes non-null with !' do
    type = GraphQL::EnumType.new
    non_null_type = !type
    assert_equal(GraphQL::TypeKinds::NON_NULL, non_null_type.kind)
    assert_equal(type, non_null_type.of_type)
    assert_equal(GraphQL::TypeKinds::NON_NULL, (!GraphQL::STRING_TYPE).kind)
  end

  it 'can be compared' do
    assert_equal(!GraphQL::INT_TYPE, !GraphQL::INT_TYPE)
    refute_equal(!GraphQL::FLOAT_TYPE, GraphQL::FLOAT_TYPE)
    assert_equal(
      GraphQL::ListType.new(of_type: MilkType),
      GraphQL::ListType.new(of_type: MilkType)
    )
    refute_equal(
      GraphQL::ListType.new(of_type: MilkType),
      GraphQL::ListType.new(of_type: !MilkType)
    )
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
graphql-0.12.1 spec/graphql/base_type_spec.rb
graphql-0.12.0 spec/graphql/base_type_spec.rb
graphql-0.11.1 spec/graphql/base_type_spec.rb
graphql-0.11.0 spec/graphql/base_type_spec.rb
graphql-0.10.9 spec/graphql/base_type_spec.rb
graphql-0.10.8 spec/graphql/base_type_spec.rb
graphql-0.10.7 spec/graphql/base_type_spec.rb
graphql-0.10.6 spec/graphql/base_type_spec.rb
graphql-0.10.5 spec/graphql/base_type_spec.rb
graphql-0.10.4 spec/graphql/base_type_spec.rb
graphql-0.10.3 spec/graphql/base_type_spec.rb
graphql-0.10.2 spec/graphql/base_type_spec.rb
graphql-0.10.1 spec/graphql/base_type_spec.rb
graphql-0.10.0 spec/graphql/base_type_spec.rb
graphql-0.9.5 spec/graphql/base_type_spec.rb
graphql-0.9.4 spec/graphql/base_type_spec.rb
graphql-0.9.3 spec/graphql/base_type_spec.rb
graphql-0.9.2 spec/graphql/base_type_spec.rb
graphql-0.8.1 spec/graphql/base_type_spec.rb
graphql-0.8.0 spec/graphql/base_type_spec.rb