spec/tty/table/options_spec.rb in tty-0.0.6 vs spec/tty/table/options_spec.rb in tty-0.0.7
- old
+ new
@@ -2,11 +2,11 @@
require 'spec_helper'
describe TTY::Table, 'options' do
let(:rows) { [['a1', 'a2'], ['b1', 'b2']] }
- let(:widths) { [] }
+ let(:widths) { nil }
let(:aligns) { [] }
let(:object) {
described_class.new rows,
:column_widths => widths,
:column_aligns => aligns,
@@ -25,9 +25,15 @@
context '#column_widths' do
let(:widths) { [10, 10] }
its(:column_widths) { should == widths }
+ end
+
+ context '#column_widths empty' do
+ let(:widths) { [] }
+
+ it { expect { subject }.to raise_error(TTY::InvalidArgument) }
end
context '#column_aligns' do
let(:aligns) { [:center, :center] }