Sha256: 8c590cb9b3df9f9a2af6baf287218871d5a859d02b812a01dc34521cce686e2b

Contents?: true

Size: 431 Bytes

Versions: 6

Compression:

Stored size: 431 Bytes

Contents

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

require 'spec_helper'

describe TTY::Table::Operation::Truncation, '#truncate' do
  let(:instance) { described_class.new }
  let(:text) { '太丸ゴシック体' }

  subject { instance.truncate(text, width) }

  context 'without shortening' do
    let(:width) { 8 }

    it { should == text }
  end

  context 'with shortening' do
    let(:width) { 5 }

    it { should == '太丸ゴシ…' }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tty-0.0.9 spec/tty/table/operation/truncation/truncate_spec.rb
tty-0.0.8 spec/tty/table/operation/truncation/truncate_spec.rb
tty-0.0.7 spec/tty/table/operation/truncation/truncate_spec.rb
tty-0.0.6 spec/tty/table/operation/truncation/truncate_spec.rb
tty-0.0.5 spec/tty/table/operation/truncation/truncate_spec.rb
tty-0.0.4 spec/tty/table/operation/truncation/truncate_spec.rb