Sha256: 3a87d9843ad4f8e7d8523e6311d283f30d65bb4f66680b63724a09972a451f35

Contents?: true

Size: 622 Bytes

Versions: 3

Compression:

Stored size: 622 Bytes

Contents

require 'test_helper'

require File.join(File.dirname(__FILE__), '..', '..', 'lib/cliutils/prefs/pref_validators/url_validator')

# Tests for the Configurator class
class TestUrlValidator < Test::Unit::TestCase
  def test_valid
    v = CLIUtils::UrlValidator.new
    v.validate('http://www.google.com')

    assert_equal(v.is_valid, 0)
    assert_equal(v.message, 'Response is not a url: http://www.google.com')
  end

  def test_invalid
    v = CLIUtils::UrlValidator.new
    v.validate('basdahd0283123')

    assert_not_equal(v.is_valid, 0)
    assert_equal(v.message, 'Response is not a url: basdahd0283123')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cliutils-2.1.4 test/validator_tests/url_validator_test.rb
cliutils-2.1.3 test/validator_tests/url_validator_test.rb
cliutils-2.1.2 test/validator_tests/url_validator_test.rb