Sha256: 73dca73f49499496183ce372f213bd641d9c74d4a7e77d81cb87e89d44de3095

Contents?: true

Size: 498 Bytes

Versions: 3

Compression:

Stored size: 498 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

3 entries across 3 versions & 1 rubygems

Version Path
tty-0.1.2 spec/tty/table/row/height_spec.rb
tty-0.1.1 spec/tty/table/row/height_spec.rb
tty-0.1.0 spec/tty/table/row/height_spec.rb