Sha256: a0d4ba5f372cfb6b85e1ab0fe6f8e0f679f1eeb667c8ff0acea83bc1dbf77a9e

Contents?: true

Size: 553 Bytes

Versions: 5

Compression:

Stored size: 553 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'spec_helper'

describe TTY::Table::ColumnSet, '#extract_widths!' do

  let(:header) { ['h1', 'h2', 'h3'] }
  let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']] }

  let(:table) {
    stub(:table, :column_widths => column_widths,
     :header => header, :to_a => rows).as_null_object
  }

  subject { described_class.new table }

  context 'with column_widths' do
    let(:column_widths) { [5,5,5] }

    it '' do
      subject.extract_widths!
      subject.column_widths.should == column_widths
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tty-0.0.9 spec/tty/table/column_set/extract_widths_spec.rb
tty-0.0.8 spec/tty/table/column_set/extract_widths_spec.rb
tty-0.0.7 spec/tty/table/column_set/extract_widths_spec.rb
tty-0.0.6 spec/tty/table/column_set/extract_widths_spec.rb
tty-0.0.5 spec/tty/table/column_set/extract_widths_spec.rb