Sha256: a3bcbe84e0b1c8dcc2963755d810d8f8e2ea7339ed08e231a068e7382ace0798

Contents?: true

Size: 646 Bytes

Versions: 5

Compression:

Stored size: 646 Bytes

Contents

require 'dry/validation/predicates'

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

    context 'when value is a date' do
      let(:arguments_list) do
        [[true], [false]]
      end

      it_behaves_like 'a passing predicate'
    end

    context 'with value is not an integer' do
      let(:arguments_list) do
        [
          [''],
          [[]],
          [{}],
          [nil],
          [:symbol],
          [String],
          [1],
          [0],
          ['true'],
          ['false']
        ]
      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/bool_spec.rb
dry-validation-0.4.0 spec/unit/predicates/bool_spec.rb
dry-validation-0.3.1 spec/unit/predicates/bool_spec.rb
dry-validation-0.3.0 spec/unit/predicates/bool_spec.rb
dry-validation-0.2.0 spec/unit/predicates/bool_spec.rb