Sha256: 1b032e0f5b2009cf3896f733f87d1e1851c63ae2b5e1f0fc58a753a54bbad4ab

Contents?: true

Size: 468 Bytes

Versions: 8

Compression:

Stored size: 468 Bytes

Contents

# coding: utf-8

require 'spec_helper'

RSpec.describe TTY::Table::Indentation, '.indent' do
  let(:indent) { 2 }

  subject(:indentation) { described_class.new(indent) }

  context 'when enumerable' do
    it 'inserts indentation for each element' do
      expect(indentation.indent(['line1'])).to eql(['  line1'])
    end
  end

  context 'when string' do
    it 'inserts indentation' do
      expect(indentation.indent('line1')).to eql('  line1')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tty-table-0.9.0 spec/unit/indentation/indent_spec.rb
tty-table-0.8.0 spec/unit/indentation/indent_spec.rb
tty-table-0.7.0 spec/unit/indentation/indent_spec.rb
tty-table-0.6.0 spec/unit/indentation/indent_spec.rb
tty-table-0.5.0 spec/unit/indentation/indent_spec.rb
tty-table-0.4.0 spec/unit/indentation/indent_spec.rb
tty-table-0.3.0 spec/unit/indentation/indent_spec.rb
tty-table-0.2.0 spec/unit/indentation/indent_spec.rb