Module: Cuprum::Collections::RSpec::Contracts::Scopes::LogicalContracts::ShouldBeADisjunctionScopeContract Deprecated
- Extended by:
- RSpec::SleepingKingStudios::Contract
- Defined in:
- lib/cuprum/collections/rspec/contracts/scopes/logical_contracts.rb
Overview
Deprecated.
0.6.0
Contract validating the behavior of a logical OR scope implementation.
Instance Method Summary collapse
-
#apply(example_group, abstract: false) ⇒ Object
Adds the contract to the example group.
Instance Method Details
#apply(example_group, abstract: false) ⇒ Object
Adds the contract to the example group.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/cuprum/collections/rspec/contracts/scopes/logical_contracts.rb', line 97 contract do |abstract: false| = 'Use deferred examples "should implement the DisjunctionScope ' \ 'methods"' SleepingKingStudios::Tools::Toolbelt .instance .core_tools .deprecate( 'ShouldBeADisjunctionScopeContract', message: ) include_contract 'should be a container scope', invertible: true include_contract 'should compose scopes for disjunction' describe '#as_json' do let(:expected) do { 'scopes' => subject.scopes.map(&:as_json), 'type' => subject.type } end it { expect(subject.as_json).to be == expected } wrap_context 'with scopes' do it { expect(subject.as_json).to be == expected } end end describe '#call' do next if abstract include_contract 'should filter data by logical or' end describe '#invert' do let(:expected) do Cuprum::Collections::Scopes::ConjunctionScope.new( scopes: subject.scopes.map(&:invert) ) end it { expect(subject.invert).to be == expected } wrap_context 'with scopes' do it { expect(subject.invert).to be == expected } end end describe '#type' do include_examples 'should define reader', :type, :disjunction end end |