Sha256: 943805ed68665fb799089ea96be75967c40f9c1e2a99de49281bd094d150296e

Contents?: true

Size: 878 Bytes

Versions: 3

Compression:

Stored size: 878 Bytes

Contents

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

require 'spec_helper'

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

  subject { described_class.new row }

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

    it 'draws top line' do
      subject.top_line.should be_nil
    end

    it 'draws middle line' do
      subject.separator.should be_nil
    end

    it 'draw bottom line' do
      subject.bottom_line.should be_nil
    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 be_nil
    end

    it 'draw middle line' do
      subject.separator.should be_nil
    end

    it 'draw bottom line' do
      subject.bottom_line.should be_nil
    end

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

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tty-0.0.7 spec/tty/table/border/null/rendering_spec.rb
tty-0.0.6 spec/tty/table/border/null/rendering_spec.rb
tty-0.0.5 spec/tty/table/border/null/rendering_spec.rb