Sha256: 45c1ddea1c79a79e89bee4e561a681b77c71c7a3a05770ac561aa541ae9bd4eb
Contents?: true
Size: 1.21 KB
Versions: 4
Compression:
Stored size: 1.21 KB
Contents
require 'dry/logic/predicates' RSpec.describe Dry::Logic::Predicates do describe '#includes?' do let(:predicate_name) { :includes? } context 'when input includes value' do let(:arguments_list) do [ ['Jill', ['Jill', 'John']], ['John', ['Jill', 'John']], [1, 1..2], [2, 1..2], ['Hello', 'Hello World'], ['World', 'Hello World'], [:bar, { bar: 0 }], [nil, [nil, false]], [false, [nil, false]] ] end it_behaves_like 'a passing predicate' end context 'with input of invalid type' do let(:arguments_list) do [ [2, 1], [1, nil], ["foo", 1], [1, "foo"], [1..2, "foo"], ["foo", 1..2], [:key, "foo"] ] end it_behaves_like 'a failing predicate' end context 'with input excludes value' do let(:arguments_list) do [ ['Jack', ['Jill', 'John']], [0, 1..2], [3, 1..2], ['foo', 'Hello World'], [:foo, { bar: 0 }], [true, [nil, false]] ] end it_behaves_like 'a failing predicate' end end end
Version data entries
4 entries across 4 versions & 1 rubygems