Sha256: d9c8822588a3c1fa78be1af071531129050dd88a8cd9afceeb43d19fea003c61

Contents?: true

Size: 656 Bytes

Versions: 7

Compression:

Stored size: 656 Bytes

Contents

require_relative '../spec_helper'
require 'cliutils/messaging'
require 'cliutils/prefs/pref_validators/pref_validator'
require 'cliutils/prefs/pref_validators/url_validator'

describe CLIUtils::UrlValidator do
  it 'confirms that its input is a URL' do
    v = CLIUtils::UrlValidator.new
    v.validate('http://www.google.com')
    expect(v.is_valid).to be_true
    expect(v.message).to eq('Response is not a URL: http://www.google.com')
  end

  it 'confirms that its input is not a URL' do
    v = CLIUtils::UrlValidator.new
    v.validate('!@&^')
    expect(v.is_valid).to_not be_true
    expect(v.message).to eq('Response is not a URL: !@&^')
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cliutils-2.2.6 spec/validator/url_validator_spec.rb
cliutils-2.2.5 spec/validator/url_validator_spec.rb
cliutils-2.2.4 spec/validator/url_validator_spec.rb
cliutils-2.2.3 spec/validator/url_validator_spec.rb
cliutils-2.2.2 spec/validator/url_validator_spec.rb
cliutils-2.2.1 spec/validator/url_validator_spec.rb
cliutils-2.2.0 spec/validator/url_validator_spec.rb