Sha256: ceca619ef82696e03b7fc8e0d11d28467988dc32abe7adc1c0e9e61b5b913d01

Contents?: true

Size: 728 Bytes

Versions: 2

Compression:

Stored size: 728 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Aggregate::Maximum, '.call' do
  subject { object.call(maximum, value) }

  let(:object)   { described_class }
  let(:maximum)  { 0               }
  let(:value)    { 1               }

  context 'when the value is greater than the maximum' do
    let(:value) { 1 }

    it { should eql(1) }
  end

  context 'when the value is equal to the maximum' do
    let(:value) { 0 }

    it { should eql(0) }
  end

  context 'when the value is less than the maximum' do
    let(:value) { -1 }

    it { should eql(0) }
  end

  context 'when the value is nil' do
    let(:value)   { nil               }
    let(:maximum) { double('Maximum') }

    it { should be(maximum) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-0.2.0 spec/unit/axiom/aggregate/maximum/class_methods/call_spec.rb
axiom-0.1.1 spec/unit/axiom/aggregate/maximum/class_methods/call_spec.rb