Sha256: 41337baf44b63b5f044d496345b4436edcfaf0ffe1e5e278a60c654009bf611a

Contents?: true

Size: 693 Bytes

Versions: 5

Compression:

Stored size: 693 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Function::Connective::Negation::InvertibleOperand, '#optimizable?' do
  subject { object.optimizable? }

  let(:attribute) { Attribute::Integer.new(:id)                 }
  let(:negation)  { Function::Connective::Negation.new(operand) }
  let(:object)    { described_class.new(negation)               }

  before do
    object.operation.should be_kind_of(Function::Connective::Negation)
  end

  context 'when operand is invertible' do
    let(:operand) { attribute.eq(1) }

    it { should be(true) }
  end

  context 'when operand is not invertible' do
    let(:operand) { proc { true } }

    it { should be(false) }
  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
axiom-optimizer-0.1.0 spec/unit/axiom/optimizer/function/connective/negation/invertible_operand/optimizable_predicate_spec.rb
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/function/connective/negation/invertible_operand/optimizable_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/function/connective/negation/invertible_operand/optimizable_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/function/connective/negation/invertible_operand/optimizable_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/function/connective/negation/invertible_operand/optimizable_spec.rb