Sha256: 61bead2d6c1829f552cc17d325e483ae0ff4255b9e9e22e0203de813c39f702b

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Aggregate::Sum, '#default' do
  subject { object.default }

  let(:object) { described_class.new(attribute) }

  context 'when the attribute is an Integer' do
    let(:attribute) { Attribute::Integer.new(:integer) }

    it { should be_kind_of(attribute.class.primitive) }

    it { should be_zero }
  end

  context 'when the attribute is a Float' do
    let(:attribute) { Attribute::Float.new(:float) }

    it { should be_instance_of(attribute.class.primitive) }

    it { should be_zero }
  end

  context 'when the attribute is a Decimal' do
    let(:attribute) { Attribute::Decimal.new(:decimal) }

    it { should be_instance_of(attribute.class.primitive) }

    it { should be_zero }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/aggregate/sum/default_spec.rb