Sha256: a72072aa9c9c2aeaf493b8ee89975c8f6f56fc00cf6fc64b18e96d673dda8f46

Contents?: true

Size: 606 Bytes

Versions: 4

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

require 'dry/logic/predicates'

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

    context 'when value is a time' do
      let(:arguments_list) do
        [[Time.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

4 entries across 4 versions & 1 rubygems

Version Path
dry-logic-1.0.5 spec/unit/predicates/time_spec.rb
dry-logic-1.0.4 spec/unit/predicates/time_spec.rb
dry-logic-1.0.3 spec/unit/predicates/time_spec.rb
dry-logic-1.0.2 spec/unit/predicates/time_spec.rb