Sha256: f4a1adfdafeeb8b9629e048a7442fdea8a1a55eef2b94b416735817f565bd773

Contents?: true

Size: 481 Bytes

Versions: 7

Compression:

Stored size: 481 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Function::Util, '.constant?' do
  subject { object.constant?(operand) }

  let(:object) { Optimizer::Function::Util }

  context 'with a constant' do
    let(:operand) { 1 }

    it { should be(true) }
  end

  context 'with an attribute' do
    let(:operand) { Attribute::Integer.new(:id) }

    it { should be(false) }
  end

  context 'with a nil' do
    let(:operand) { nil }

    it { should be(false) }
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/function/util/class_methods/constant_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/function/util/class_methods/constant_spec.rb
axiom-optimizer-0.1.0 spec/unit/axiom/optimizer/function/util/class_methods/constant_spec.rb
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/function/util/class_methods/constant_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/function/util/class_methods/constant_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/function/util/class_methods/constant_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/function/util/class_methods/constant_spec.rb