Sha256: c26b571c6d07fd2e5c188d99a9c7eb733416ece42d5859c8bd60d4706f3e9a0c

Contents?: true

Size: 427 Bytes

Versions: 45

Compression:

Stored size: 427 Bytes

Contents

require "spec_helper"

describe GraphQL::FLOAT_TYPE do
  describe "coerce_input" do
    it "accepts ints and floats" do
      assert_equal 1.0, GraphQL::FLOAT_TYPE.coerce_input(1)
      assert_equal 6.1, GraphQL::FLOAT_TYPE.coerce_input(6.1)
    end

    it "rejects other types" do
      assert_equal nil, GraphQL::FLOAT_TYPE.coerce_input("55")
      assert_equal nil, GraphQL::FLOAT_TYPE.coerce_input(true)
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

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