Sha256: dde620ab4c1804f0bc8252798dcfe68e10e02445f3835d5423ea65c7db6da63e

Contents?: true

Size: 999 Bytes

Versions: 5

Compression:

Stored size: 999 Bytes

Contents

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

require 'spec_helper'

describe TTY::Table::Border::Unicode, '#rendering' do

  subject { described_class.new row }

  context 'with empty row' do
    let(:row) { [] }

    it 'draws top line' do
      subject.top_line.should == "┌┐"
    end

    it 'draws middle line' do
      subject.separator.should == "├┤"
    end

    it 'draw bottom line' do
      subject.bottom_line.should == "└┘"
    end

    it 'draws row line' do
      subject.row_line.should == "││"
    end
  end

  context 'with row' do
    let(:row) { ['a1', 'a2', 'a3'] }

    it 'draws top line' do
      subject.top_line.should == "┌──┬──┬──┐"
    end

    it 'draw middle line' do
      subject.separator.should == "├──┼──┼──┤"
    end

    it 'draw bottom line' do
      subject.bottom_line.should == "└──┴──┴──┘"
    end

    it 'draws row line' do
      subject.row_line.should == "│a1│a2│a3│"
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tty-0.0.9 spec/tty/table/border/unicode/rendering_spec.rb
tty-0.0.8 spec/tty/table/border/unicode/rendering_spec.rb
tty-0.0.7 spec/tty/table/border/unicode/rendering_spec.rb
tty-0.0.6 spec/tty/table/border/unicode/rendering_spec.rb
tty-0.0.5 spec/tty/table/border/unicode/rendering_spec.rb