Sha256: 11cbe2cfc946ae8d9fc171f1ff9bc440ebd09847e8092654f06e9242136966cb

Contents?: true

Size: 395 Bytes

Versions: 4

Compression:

Stored size: 395 Bytes

Contents

require 'uri'

module CLIUtils
  # A Validator to verify whether a Pref answer
  # is a valid URL.
  class TestValidator < PrefValidator
    # Runs the Validator against the answer.
    # @param [Object] text The "text" to evaluate
    # @return [String]
    def validate(text)
      @is_valid = text.to_s == "bachya"
      @message = "String did not equal 'bachya': #{ text }"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cliutils-2.1.4 test/test_files/test_validator.rb
cliutils-2.1.3 test/test_files/test_validator.rb
cliutils-2.1.2 test/test_files/test_validator.rb
cliutils-2.1.1 test/test_files/test_validator.rb