Sha256: b07cb08ae0165d8f1d43846762642a19c1657ba89405c60a4cecb54e7ec0bb56

Contents?: true

Size: 431 Bytes

Versions: 5

Compression:

Stored size: 431 Bytes

Contents

RSpec.describe Rule::Composite::Implication do
  subject(:rule) { Rule::Composite::Implication.new(left, right) }

  let(:left) { Rule::Value.new(:age, Predicates[:int?]) }
  let(:right) { Rule::Value.new(:age, Predicates[:gt?].curry(18)) }

  describe '#call' do
    it 'calls left and right' do
      expect(rule.('19')).to be_success
      expect(rule.(19)).to be_success
      expect(rule.(18)).to be_failure
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-validation-0.4.1 spec/unit/rule/implication_spec.rb
dry-validation-0.4.0 spec/unit/rule/implication_spec.rb
dry-validation-0.3.1 spec/unit/rule/implication_spec.rb
dry-validation-0.3.0 spec/unit/rule/implication_spec.rb
dry-validation-0.2.0 spec/unit/rule/implication_spec.rb