Sha256: 37c543ad66b83f052f377c1ec08e7b056213527e079affff4acdaff7ed224ca7

Contents?: true

Size: 736 Bytes

Versions: 4

Compression:

Stored size: 736 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe SQL::Generator::Function::Aggregate, '#visit_veritas_aggregate_sum' do
  subject { object.visit_veritas_aggregate_sum(sum) }

  let(:described_class) { Class.new(SQL::Generator::Visitor) { include SQL::Generator::Function::Aggregate } }
  let(:attribute)       { Attribute::Integer.new(:id)                                                        }
  let(:sum)             { attribute.sum                                                                      }
  let(:object)          { described_class.new                                                                }

  it_should_behave_like 'a generated SQL expression'

  its(:to_s) { should eql('COALESCE (SUM ("id"), 0)') }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-sql-generator-0.0.7 spec/unit/veritas/sql/generator/function/aggregate/visit_veritas_aggregate_sum_spec.rb
veritas-sql-generator-0.0.6 spec/unit/veritas/sql/generator/function/aggregate/visit_veritas_aggregate_sum_spec.rb
veritas-sql-generator-0.0.5 spec/unit/veritas/sql/generator/function/aggregate/visit_veritas_aggregate_sum_spec.rb
veritas-sql-generator-0.0.4 spec/unit/veritas/sql/generator/function/aggregate/visit_veritas_aggregate_sum_spec.rb