Sha256: 8557195363a417f1cdbba4a099901d6e90250fefd6ac91f842202eb1c8e2f3f4

Contents?: true

Size: 913 Bytes

Versions: 5

Compression:

Stored size: 913 Bytes

Contents

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

require 'spec_helper'

describe TTY::Table::Border::ASCII, '#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/ascii/rendering_spec.rb
tty-0.0.8 spec/tty/table/border/ascii/rendering_spec.rb
tty-0.0.7 spec/tty/table/border/ascii/rendering_spec.rb
tty-0.0.6 spec/tty/table/border/ascii/rendering_spec.rb
tty-0.0.5 spec/tty/table/border/ascii/rendering_spec.rb