Sha256: 34b2e7480e27627e6ef484f4cedfc1e1bec9d923ac3a63d6e5f8f5c5c6357f02

Contents?: true

Size: 805 Bytes

Versions: 3

Compression:

Stored size: 805 Bytes

Contents

class LicenseTest < Test::Unit::TestCase
  sub_test_case(".try_convert") do
    test("String") do
      assert_equal(Datasets::License.new("Apache-2.0"),
                   Datasets::License.try_convert("Apache-2.0"))
    end

    test("{spdx_id:}") do
      assert_equal(Datasets::License.new("Apache-2.0"),
                   Datasets::License.try_convert(spdx_id: "Apache-2.0"))
    end

    test("{name:, url:}") do
      license = {
        name: "Quora's Terms of Service",
        url: "https://www.quora.com/about/tos",
      }
      assert_equal(Datasets::License.new(nil,
                                         "Quora's Terms of Service",
                                         "https://www.quora.com/about/tos"),
                   Datasets::License.try_convert(license))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
red-datasets-0.1.7 test/test-license.rb
red-datasets-0.1.6 test/test-license.rb
red-datasets-0.1.5 test/test-license.rb