Sha256: 96384113b25d1d7cc86a478c8db3ff8d65cb18c094a767c43ce0ba90413f9097

Contents?: true

Size: 538 Bytes

Versions: 6

Compression:

Stored size: 538 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.2.1 spec/tty/shell/print_table_spec.rb
tty-0.2.0 spec/tty/shell/print_table_spec.rb
tty-0.1.3 spec/tty/shell/print_table_spec.rb
tty-0.1.2 spec/tty/shell/print_table_spec.rb
tty-0.1.1 spec/tty/shell/print_table_spec.rb
tty-0.1.0 spec/tty/shell/print_table_spec.rb