Sha256: 643687a449cce2e7f2176d440683208f5d0c3981f9826f5b904047b31d5bfa84

Contents?: true

Size: 438 Bytes

Versions: 45

Compression:

Stored size: 438 Bytes

Contents

require "spec_helper"

describe GraphQL::STRING_TYPE do
  describe "coerce_input" do
    it "accepts strings" do
      assert_equal "str", GraphQL::STRING_TYPE.coerce_input("str")
    end

    it "doesn't accept other types" do
      assert_equal nil, GraphQL::STRING_TYPE.coerce_input(100)
      assert_equal nil, GraphQL::STRING_TYPE.coerce_input(true)
      assert_equal nil, GraphQL::STRING_TYPE.coerce_input(0.999)
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

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