Sha256: 8a3462441576904c324f09cef0aaba5f99227541fa1aceee129b66178ff62dca

Contents?: true

Size: 554 Bytes

Versions: 5

Compression:

Stored size: 554 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

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

  context 'with an Integer attribute' do
    let(:operand) { Attribute::Integer.new(:id, :size => 1..10) }

    it { should == 10 }
  end

  context 'with a String attribute' do
    let(:operand) { Attribute::String.new(:id, :min_length => 1, :max_length => 10) }

    it { should == 10 }
  end

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

    it { should == 1 }
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

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