spec/unit/rule/check_spec.rb in dry-logic-0.1.2 vs spec/unit/rule/check_spec.rb in dry-logic-0.1.3

- old
+ new

@@ -1,29 +1,31 @@ RSpec.describe Rule::Check do - subject(:rule) { Rule::Check.new(:name, other.(input).curry(predicate)) } + subject(:rule) do + Rule::Check::Unary.new(:name, other.(input).curry(predicate), [:name]) + end include_context 'predicates' let(:other) do Rule::Value.new(:name, none?).or(Rule::Value.new(:name, filled?)) end describe '#call' do - context 'when a given predicate passed' do + context 'when then given predicate passed' do let(:input) { 'Jane' } let(:predicate) { :filled? } it 'returns a success' do - expect(rule.()).to be_success + expect(rule.('Jane')).to be_success end end - context 'when a given predicate did not pass' do + context 'when the given predicate did not pass' do let(:input) { nil } let(:predicate) { :filled? } it 'returns a failure' do - expect(rule.()).to be_failure + expect(rule.(nil)).to be_failure end end end end