Sha256: fbf7e1677d50683e07a3171e0af6ab6e0497675976385b899eecd504fc14036c

Contents?: true

Size: 584 Bytes

Versions: 2

Compression:

Stored size: 584 Bytes

Contents

require 'test_helper'

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

# Tests for the Configurator class
class TestTimeValidator < Test::Unit::TestCase
  def test_valid
    v = CLIUtils::TimeValidator.new
    v.validate('12:43 AM')

    assert_equal(v.is_valid, 0)
    assert_equal(v.message, 'Response is not a time: 12:43 AM')
  end

  def test_invalid
    v = CLIUtils::TimeValidator.new
    v.validate('bzzzp')

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cliutils-2.1.4 test/validator_tests/time_validator_test.rb
cliutils-2.1.3 test/validator_tests/time_validator_test.rb