Sha256: feae576b5cde07e791d804c552a5caacc8b322bb0880d81795fd1e19e3b230a5

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

require 'dry/logic/rule'

RSpec.describe Dry::Logic::Rule::Each do
  include_context 'predicates'

  subject(:address_rule) do
    Dry::Logic::Rule::Each.new(is_string)
  end

  let(:is_string) { Dry::Logic::Rule::Value.new(str?) }

  describe '#call' do
    it 'applies its rules to all elements in the input' do
      expect(address_rule.(['Address'])).to be_success

      expect(address_rule.([nil, 'Address'])).to be_failure
      expect(address_rule.([:Address, 'Address'])).to be_failure
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dry-logic-0.2.0 spec/unit/rule/each_spec.rb