Sha256: b27c2671059808244e9749ff425be4887cc224209ed3535c1869c04bbc83c35c

Contents?: true

Size: 579 Bytes

Versions: 5

Compression:

Stored size: 579 Bytes

Contents

require "test_helper"

class WithoutTldValidationTest < Minitest::Test
  VALID_HOSTNAMES.each do |host|
    test "accepts #{host}" do
      server = ServerWithoutTLD.new(host)
      assert server.valid?
    end
  end

  INVALID_HOSTNAMES.each do |host|
    test "rejects #{host}" do
      server = ServerWithoutTLD.new(host)
      refute server.valid?
    end
  end

  test "rejects nil hostname" do
    server = ServerWithoutTLD.new(nil)
    refute server.valid?
  end

  test "rejects blank hostname" do
    server = ServerWithoutTLD.new("")
    refute server.valid?
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
validators-2.8.1 test/validators/validates_hostname_format_of/without_tld_validation_test.rb
validators-2.8.0 test/validators/validates_hostname_format_of/without_tld_validation_test.rb
validators-2.7.0 test/validators/validates_hostname_format_of/without_tld_validation_test.rb
validators-2.6.0 test/validators/validates_hostname_format_of/without_tld_validation_test.rb
validators-2.5.4 test/validators/validates_hostname_format_of/without_tld_validation_test.rb