Sha256: bdedc1f9a93c359fe25aaa427967b3c75528fc91bc6254937c36b0e41c7f7694
Contents?: true
Size: 682 Bytes
Versions: 1
Compression:
Stored size: 682 Bytes
Contents
# -*- encoding: utf-8 -*- require 'spec_helper' describe TTY::Table::Operations, '#new' do let(:object) { described_class } let(:row) { [1,2,3] } let(:table) { TTY::Table.new :rows => [row] } let(:callable) { Class.new do def call(val, row, col) val.value= val.value + 1 end end } let(:instance) { callable.new } subject { object.new table } before { subject.add_operation(:alignment, instance) } it 'stores away operations' do expect(subject.operations[:alignment]).to include(instance) end it 'runs selected operations' do subject.run_operations(:alignment) expect(table.data[0]).to eql([2,3,4]) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tty-0.0.10 | spec/tty/table/operations/new_spec.rb |