Sha256: bb73a99ed665a6d055b222fa590f9439c3096caeeac841e5b8fd1c9ffb8b5ee1

Contents?: true

Size: 523 Bytes

Versions: 28

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

describe GraphQL::BOOLEAN_TYPE do
  describe "coerce_input" do
    def coerce_input(input)
      GraphQL::BOOLEAN_TYPE.coerce_isolated_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

28 entries across 28 versions & 1 rubygems

Version Path
graphql-1.8.0.pre1 spec/graphql/boolean_type_spec.rb
graphql-1.7.6 spec/graphql/boolean_type_spec.rb
graphql-1.7.5 spec/graphql/boolean_type_spec.rb
graphql-1.7.4 spec/graphql/boolean_type_spec.rb
graphql-1.7.3 spec/graphql/boolean_type_spec.rb
graphql-1.7.2 spec/graphql/boolean_type_spec.rb
graphql-1.7.1 spec/graphql/boolean_type_spec.rb
graphql-1.7.0 spec/graphql/boolean_type_spec.rb
graphql-1.6.8 spec/graphql/boolean_type_spec.rb
graphql-1.6.7 spec/graphql/boolean_type_spec.rb
graphql-1.6.6 spec/graphql/boolean_type_spec.rb
graphql-1.6.5 spec/graphql/boolean_type_spec.rb
graphql-1.6.4 spec/graphql/boolean_type_spec.rb
graphql-1.5.15 spec/graphql/boolean_type_spec.rb
graphql-1.6.3 spec/graphql/boolean_type_spec.rb
graphql-1.6.2 spec/graphql/boolean_type_spec.rb
graphql-1.6.1 spec/graphql/boolean_type_spec.rb
graphql-1.6.0 spec/graphql/boolean_type_spec.rb
graphql-1.5.14 spec/graphql/boolean_type_spec.rb
graphql-1.5.13 spec/graphql/boolean_type_spec.rb