Sha256: 727873ba83c8edf343deb0c937052163098cadde3a43903b6690100129be69b5

Contents?: true

Size: 610 Bytes

Versions: 5

Compression:

Stored size: 610 Bytes

Contents

RSpec.describe Rule::ExclusiveDisjunction do
  include_context 'predicates'

  subject(:rule) do
    Rule::ExclusiveDisjunction.new(left, right)
  end

  let(:left) { Rule::Key.new(true?, name: :eat_cake) }
  let(:right) { Rule::Key.new(true?, name: :have_cake) }

  describe '#call' do
    it 'calls left and right' do
      expect(rule.(eat_cake: true, have_cake: false)).to be_success
      expect(rule.(eat_cake: false, have_cake: true)).to be_success
      expect(rule.(eat_cake: false, have_cake: false)).to be_failure
      expect(rule.(eat_cake: true, have_cake: true)).to be_failure
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-logic-0.3.0 spec/unit/rule/exclusive_disjunction_spec.rb
dry-logic-0.2.3 spec/unit/rule/exclusive_disjunction_spec.rb
dry-logic-0.2.2 spec/unit/rule/exclusive_disjunction_spec.rb
dry-logic-0.2.1 spec/unit/rule/exclusive_disjunction_spec.rb
dry-logic-0.2.0 spec/unit/rule/exclusive_disjunction_spec.rb