Sha256: f3db5c84e78246ebbd077a53e642eb710d1dd49ca4aaf5d0e7cc801fd23ae099

Contents?: true

Size: 612 Bytes

Versions: 3

Compression:

Stored size: 612 Bytes

Contents

require 'test_helper'

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

# Tests for the Configurator class
class TestAlphabeticValidator < Test::Unit::TestCase
  def test_valid
    v = CLIUtils::AlphabeticValidator.new
    v.validate('bachya')

    assert_equal(v.is_valid, 0)
    assert_equal(v.message, 'Response is not alphabetic: bachya')
  end

  def test_invalid
    v = CLIUtils::AlphabeticValidator.new
    v.validate('12345')

    assert_not_equal(v.is_valid, 0)
    assert_equal(v.message, 'Response is not alphabetic: 12345')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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