Sha256: c65b6b416ac45c6f5fa186425a78a91cbb1cc0131c7fbe9285110b8be7b4b7b0

Contents?: true

Size: 493 Bytes

Versions: 28

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true
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_isolated_input(1)
      assert_equal 6.1, GraphQL::FLOAT_TYPE.coerce_isolated_input(6.1)
    end

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

Version data entries

28 entries across 28 versions & 1 rubygems

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