spec/unit/renderer/ascii/separator_spec.rb in tty-table-0.10.0 vs spec/unit/renderer/ascii/separator_spec.rb in tty-table-0.11.0
- old
+ new
@@ -1,9 +1,7 @@
-# coding: utf-8
+# frozen_string_literal: true
-require 'spec_helper'
-
RSpec.describe TTY::Table::Renderer::ASCII, 'with separator' do
let(:header) { ['h1', 'h2', 'h3'] }
let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']] }
let(:table) { TTY::Table.new(header, rows) }
@@ -11,14 +9,26 @@
subject(:renderer) { object }
context 'when ascii' do
it "renders each row" do
- renderer.border.separator= :each_row
+ renderer.border.separator = :each_row
expect(renderer.render).to eq unindent(<<-EOS)
+--+--+--+
|h1|h2|h3|
+--+--+--+
+ |a1|a2|a3|
+ +--+--+--+
+ |b1|b2|b3|
+ +--+--+--+
+ EOS
+ end
+
+ it "will not the default separator if individual separators are specified" do
+ renderer.border.separator = [1]
+ expect(renderer.render).to eq unindent(<<-EOS)
+ +--+--+--+
+ |h1|h2|h3|
|a1|a2|a3|
+--+--+--+
|b1|b2|b3|
+--+--+--+
EOS