Sha256: 0209bb982837e16ec01930f297e65472a249516fe8f8f878ccaad185dfdee893

Contents?: true

Size: 399 Bytes

Versions: 9

Compression:

Stored size: 399 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

RSpec.describe TTY::Table::Field, '#width' do
  let(:object) { described_class }

  let(:instance) { object.new(value) }

  subject { instance.width }

  context 'with only value' do
    let(:value) { 'foo' }

    it { is_expected.to eql(3) }
  end

  context 'with hash value' do
    let(:value) { "foo\nbaar" }

    it { is_expected.to eql(7) }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tty-table-0.10.0 spec/unit/field/width_spec.rb
tty-table-0.9.0 spec/unit/field/width_spec.rb
tty-table-0.8.0 spec/unit/field/width_spec.rb
tty-table-0.7.0 spec/unit/field/width_spec.rb
tty-table-0.6.0 spec/unit/field/width_spec.rb
tty-table-0.5.0 spec/unit/field/width_spec.rb
tty-table-0.4.0 spec/unit/field/width_spec.rb
tty-table-0.3.0 spec/unit/field/width_spec.rb
tty-table-0.2.0 spec/unit/field/width_spec.rb