Sha256: 5f895251e6dec6c885195433866e3f778b124aeaf35b82ca6ece0cdd740f53b0

Contents?: true

Size: 735 Bytes

Versions: 14

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

14 entries across 14 versions & 1 rubygems

Version Path
graphql-0.18.0 spec/graphql/base_type_spec.rb
graphql-0.17.2 spec/graphql/base_type_spec.rb
graphql-0.17.1 spec/graphql/base_type_spec.rb
graphql-0.17.0 spec/graphql/base_type_spec.rb
graphql-0.16.1 spec/graphql/base_type_spec.rb
graphql-0.16.0 spec/graphql/base_type_spec.rb
graphql-0.15.3 spec/graphql/base_type_spec.rb
graphql-0.15.2 spec/graphql/base_type_spec.rb
graphql-0.14.2 spec/graphql/base_type_spec.rb
graphql-0.15.1 spec/graphql/base_type_spec.rb
graphql-0.15.0 spec/graphql/base_type_spec.rb
graphql-0.14.1 spec/graphql/base_type_spec.rb
graphql-0.14.0 spec/graphql/base_type_spec.rb
graphql-0.13.0 spec/graphql/base_type_spec.rb