Sha256: 29bb9f93838aa1248adf6f9329ba1d9cff25fbd9dcf26999fbe042fffe098ea7

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

require 'dry/validation/predicates'

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

    context 'when value is an integer' do
      let(:arguments_list) do
        [
          [1],
          [33],
          [7]
        ]
      end

      it_behaves_like 'a passing predicate'
    end

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

      it_behaves_like 'a failing predicate'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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