Sha256: 3a69873df5430ddd13fb0371fd01ed115c0952eda69b1d4915b593614756a067

Contents?: true

Size: 479 Bytes

Versions: 53

Compression:

Stored size: 479 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_nil GraphQL::FLOAT_TYPE.coerce_isolated_input("55")
      assert_nil GraphQL::FLOAT_TYPE.coerce_isolated_input(true)
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
graphql-1.8.13 spec/graphql/float_type_spec.rb
graphql-1.8.12 spec/graphql/float_type_spec.rb
graphql-1.9.0.pre1 spec/graphql/float_type_spec.rb
graphql-1.8.11 spec/graphql/float_type_spec.rb
graphql-1.8.10 spec/graphql/float_type_spec.rb
graphql-1.8.9 spec/graphql/float_type_spec.rb
graphql-1.8.8 spec/graphql/float_type_spec.rb
graphql-1.8.7 spec/graphql/float_type_spec.rb
graphql-1.8.6 spec/graphql/float_type_spec.rb
graphql-1.8.5 spec/graphql/float_type_spec.rb
graphql-1.8.4 spec/graphql/float_type_spec.rb
graphql-1.8.3 spec/graphql/float_type_spec.rb
graphql-1.8.2 spec/graphql/float_type_spec.rb
graphql-1.8.1 spec/graphql/float_type_spec.rb
graphql-1.8.0 spec/graphql/float_type_spec.rb
graphql-1.8.0.pre11 spec/graphql/float_type_spec.rb
graphql-1.8.0.pre10 spec/graphql/float_type_spec.rb
graphql-1.7.14 spec/graphql/float_type_spec.rb
graphql-1.8.0.pre9 spec/graphql/float_type_spec.rb
graphql-1.8.0.pre8 spec/graphql/float_type_spec.rb