Sha256: 50927465db28e53792652515a361750201e8cffab4bcf93fd88c28adc932a5ef

Contents?: true

Size: 625 Bytes

Versions: 2

Compression:

Stored size: 625 Bytes

Contents

require File.expand_path('../support/test_helper', __FILE__)

class TypeAttributeTest < Minitest::Test
  def test_type_of_data
    assert_equal(type_of_data(String.new), 'string')
    assert_equal(type_of_data(Numeric.new), 'number')
    assert_equal(type_of_data(1), 'integer')
    assert_equal(type_of_data(true), 'boolean')
    assert_equal(type_of_data(false), 'boolean')
    assert_equal(type_of_data(Hash.new), 'object')
    assert_equal(type_of_data(nil), 'null')
    assert_equal(type_of_data(Object.new), 'any')
  end

  private

  def type_of_data(data)
    JSON::Schema::TypeAttribute.type_of_data(data)
  end
end

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/bundler/gems/json-schema-2253a5ee6679/test/type_attribute_test.rb
mountapi-0.11.1 vendor/json-schema/test/type_attribute_test.rb