Sha256: e1450c7bd66837e5d139d7600b3865ced0fe82259d500aceeaf0eeecddc80a0f

Contents?: true

Size: 733 Bytes

Versions: 4

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

require 'dry/logic/predicates'

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

    context 'when value is filled' do
      let(:arguments_list) do
        [
          ['Jill'],
          [[1, 2, 3]],
          [{ name: 'John' }],
          [true],
          [false],
          ['1'],
          ['0'],
          [:symbol],
          [String]
        ]
      end

      it_behaves_like 'a passing predicate'
    end

    context 'with value is not filled' do
      let(:arguments_list) do
        [
          [''],
          [[]],
          [{}],
          [nil]
        ]
      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/filled_spec.rb
dry-logic-1.0.4 spec/unit/predicates/filled_spec.rb
dry-logic-1.0.3 spec/unit/predicates/filled_spec.rb
dry-logic-1.0.2 spec/unit/predicates/filled_spec.rb