Sha256: 431e95eead66be236c65fd35fb331aac4421c6c9b85ef06ec912f3e3a6b638c0

Contents?: true

Size: 642 Bytes

Versions: 7

Compression:

Stored size: 642 Bytes

Contents

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

describe CLIUtils::DateValidator do
  it 'confirms that its input is a date' do
    v = CLIUtils::DateValidator.new
    v.validate('2014-02-01')
    expect(v.is_valid).to be_true
    expect(v.message).to eq('Response is not a date: 2014-02-01')
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

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