Sha256: ec927455f4986fbcc87cd302609b1742d334ae7e1987a628ac8c4eb87951c8ac

Contents?: true

Size: 502 Bytes

Versions: 10

Compression:

Stored size: 502 Bytes

Contents

# coding: utf-8

require 'spec_helper'

RSpec.describe TTY::Table::Row, '#height' do
  let(:object) { described_class.new row }

  subject { object.height }

  context 'single row' do
    let(:row) { ['a1', 'b1'] }

    it { expect(subject).to eql(1) }
  end

  context 'non escaped multiline' do
    let(:row) { ["a1\na2\na3", 'b1'] }

    it { expect(subject).to eql(3)}
  end

  context 'escaped multiline' do
    let(:row) { ["a1\\na2\\na3", 'b1'] }

    it { expect(subject).to eql(1) }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tty-table-0.10.0 spec/unit/row/height_spec.rb
tty-table-0.9.0 spec/unit/row/height_spec.rb
tty-table-0.8.0 spec/unit/row/height_spec.rb
tty-table-0.7.0 spec/unit/row/height_spec.rb
tty-table-0.6.0 spec/unit/row/height_spec.rb
tty-table-0.5.0 spec/unit/row/height_spec.rb
tty-table-0.4.0 spec/unit/row/height_spec.rb
tty-table-0.3.0 spec/unit/row/height_spec.rb
tty-table-0.2.0 spec/unit/row/height_spec.rb
tty-table-0.1.0 spec/unit/row/height_spec.rb