Sha256: f00c1da7ef77b32f8f93bc36a2f1b786e6f8666c437314844124e16559ef5296

Contents?: true

Size: 599 Bytes

Versions: 5

Compression:

Stored size: 599 Bytes

Contents

require 'dry/validation/predicates'

RSpec.describe Dry::Validation::Predicates do
  describe '#date_time?' do
    let(:predicate_name) { :date_time? }

    context 'when value is a date' do
      let(:arguments_list) do
        [[DateTime.now]]
      end

      it_behaves_like 'a passing predicate'
    end

    context 'with value is not an integer' do
      let(:arguments_list) do
        [
          [''],
          [[]],
          [{}],
          [nil],
          [:symbol],
          [String],
          [1]
        ]
      end

      it_behaves_like 'a failing predicate'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-validation-0.4.1 spec/unit/predicates/date_time_spec.rb
dry-validation-0.4.0 spec/unit/predicates/date_time_spec.rb
dry-validation-0.3.1 spec/unit/predicates/date_time_spec.rb
dry-validation-0.3.0 spec/unit/predicates/date_time_spec.rb
dry-validation-0.2.0 spec/unit/predicates/date_time_spec.rb