Sha256: 8b303e30d73b4a0df57628e92c82eccbd937c08b43b5de6c0f5625dfaeb056af

Contents?: true

Size: 484 Bytes

Versions: 45

Compression:

Stored size: 484 Bytes

Contents

require "spec_helper"

describe GraphQL::BOOLEAN_TYPE do
  describe "coerce_input" do
    def coerce_input(input)
      GraphQL::BOOLEAN_TYPE.coerce_input(input)
    end

    it "accepts true and false" do
      assert_equal true, coerce_input(true)
      assert_equal false, coerce_input(false)
    end

    it "rejects other types" do
      assert_equal nil, coerce_input("true")
      assert_equal nil, coerce_input(5.5)
      assert_equal nil, coerce_input(nil)
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
graphql-1.2.6 spec/graphql/boolean_type_spec.rb
graphql-1.2.5 spec/graphql/boolean_type_spec.rb
graphql-1.2.4 spec/graphql/boolean_type_spec.rb
graphql-1.2.3 spec/graphql/boolean_type_spec.rb
graphql-1.2.2 spec/graphql/boolean_type_spec.rb
graphql-1.2.1 spec/graphql/boolean_type_spec.rb
graphql-1.2.0 spec/graphql/boolean_type_spec.rb
graphql-1.1.0 spec/graphql/boolean_type_spec.rb
graphql-1.0.0 spec/graphql/boolean_type_spec.rb
graphql-0.19.4 spec/graphql/boolean_type_spec.rb
graphql-0.19.3 spec/graphql/boolean_type_spec.rb
graphql-0.19.2 spec/graphql/boolean_type_spec.rb
graphql-0.19.1 spec/graphql/boolean_type_spec.rb
graphql-0.19.0 spec/graphql/boolean_type_spec.rb
graphql-0.18.15 spec/graphql/boolean_type_spec.rb
graphql-0.18.14 spec/graphql/boolean_type_spec.rb
graphql-0.18.13 spec/graphql/boolean_type_spec.rb
graphql-0.18.12 spec/graphql/boolean_type_spec.rb
graphql-0.18.11 spec/graphql/boolean_type_spec.rb
graphql-0.18.10 spec/graphql/boolean_type_spec.rb