Sha256: cb71fb5b3278176aa0d2bab441eebeb958a7bd07d088d55f23accce827746664

Contents?: true

Size: 1017 Bytes

Versions: 4

Compression:

Stored size: 1017 Bytes

Contents

shared_examples 'a collection of columns' do
  let(:build_result) { instance.build }

  context 'column count' do
    subject { build_result.columns.length }
    it { is_expected.to eq 3 }
  end

  context 'column headers' do
    subject { build_result.column_headers }
    it { is_expected.to eq column_headers }
  end

  context '1st column' do
    subject { build_result.columns[0] }
    its(:header) { is_expected.to eq column_headers[0] }
    its(:data) { is_expected.to eq column_0 }
    its(:total) { is_expected.to eq column_totals[0] }
  end

  context '2nd column' do
    subject { build_result.columns[1] }
    its(:header) { is_expected.to eq column_headers[1] }
    its(:data) { is_expected.to eq column_1 }
    its(:total) { is_expected.to eq column_totals[1] }
  end

  context '3rd column' do
    subject { build_result.columns[2] }
    its(:header) { is_expected.to eq column_headers[2] }
    its(:data) { is_expected.to eq column_2 }
    its(:total) { is_expected.to eq column_totals[2] }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pivot_table-1.0.0 spec/support/shared_examples_for_a_collection_of_columns.rb
pivot_table-0.5.0 spec/support/shared_examples_for_a_collection_of_columns.rb
pivot_table-0.4.0 spec/support/shared_examples_for_a_collection_of_columns.rb
pivot_table-0.3.0 spec/support/shared_examples_for_a_collection_of_columns.rb