Sha256: 34eeceef5b6f653142d6fab3af94e9781d83932b51f50843cdbb028a4a872a9a

Contents?: true

Size: 547 Bytes

Versions: 6

Compression:

Stored size: 547 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'spec_helper'

describe TTY::Shell, '#print_table' do
  let(:input)  { StringIO.new }
  let(:output) { StringIO.new }
  let(:header) { ['h1', 'h2'] }
  let(:rows) { [['a1', 'a2'], ['b1', 'b2']] }

  subject(:shell) { TTY::Shell.new(input, output) }

  it 'prints a table' do
    shell.print_table header, rows, :renderer => :ascii
    expect(output.string).to eql <<-EOS.normalize
        +--+--+
        |h1|h2|
        +--+--+
        |a1|a2|
        |b1|b2|
        +--+--+\n
    EOS
  end

end # print_table

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tty-0.0.11 spec/tty/shell/print_table_spec.rb
tty-0.0.10 spec/tty/shell/print_table_spec.rb
tty-0.0.9 spec/tty/shell/print_table_spec.rb
tty-0.0.8 spec/tty/shell/print_table_spec.rb
tty-0.0.7 spec/tty/shell/print_table_spec.rb
tty-0.0.6 spec/tty/shell/print_table_spec.rb