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.5.7.1 spec/graphql/float_type_spec.rb
graphql-1.5.12 spec/graphql/float_type_spec.rb
graphql-1.5.11 spec/graphql/float_type_spec.rb
graphql-1.5.10 spec/graphql/float_type_spec.rb
graphql-1.5.9 spec/graphql/float_type_spec.rb
graphql-1.5.8 spec/graphql/float_type_spec.rb
graphql-1.5.7 spec/graphql/float_type_spec.rb
graphql-1.5.6 spec/graphql/float_type_spec.rb