Sha256: f3b17fee426266d9304d61e259d102f52a206a09d8682c1dde9bb2ddc941b567
Contents?: true
Size: 967 Bytes
Versions: 9
Compression:
Stored size: 967 Bytes
Contents
# coding: utf-8 require 'spec_helper' RSpec.describe TTY::Table::Operation::Alignment, '#call' do let(:object) { described_class.new alignments, widths } let(:value) { 'a1' } let(:field) { TTY::Table::Field.new(value)} subject { object.call(field, 0, 0) } context 'aligned with column widths and no alignments' do let(:alignments) { [] } let(:widths) { [4, 4] } it { is_expected.to eq("#{value} ") } end context 'aligned with column widths and alignments' do let(:alignments) { [:right, :left] } let(:widths) { [4, 4] } it { is_expected.to eq(" #{value}") } end context 'aligned with no column widths and no alignments' do let(:alignments) { [] } let(:widths) { [] } it { is_expected.to eq("#{value}") } end context 'aligned with no column widths and alignments' do let(:alignments) { [:right, :left] } let(:widths) { [] } it { is_expected.to eq("#{value}") } end end
Version data entries
9 entries across 9 versions & 1 rubygems