Sha256: 2a943f4dc151ac071910e73aae3a4a24d10a8b86f6c527ae28c0e2112c401928

Contents?: true

Size: 828 Bytes

Versions: 7

Compression:

Stored size: 828 Bytes

Contents

# -*- encoding: utf-8 -*-
#
require 'spec_helper'

RSpec.describe Brcobranca::FormatacaoString do
  context 'no arguments' do
    it { expect { ''.format_size }.to raise_error(ArgumentError) }
  end

  context 'blank' do
    it { expect(' '.format_size(10)).to eq('          ') }
    it { expect(''.format_size(10)).to eq('          ') }
  end

  context 'above size' do
    it { expect('SOCIEDADE BRASILEIRA DE ZOOLOGIA LTDA'.format_size(30)).to eql('SOCIEDADE BRASILEIRA DE ZOOLOG') }
    it { expect('pablo diego JOSÉ FRANCISCO DE PAULA JUAN'.format_size(30)).to eql('pablo diego JOSE FRANCISCO DE ') }
  end

  context 'bellow size' do
    it { expect('SOCIEDADE'.format_size(30)).to eql('SOCIEDADE                     ') }
    it { expect('caçaróla'.format_size(30)).to eql('cacarola                      ') }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
brcobranca-8.0.0 spec/brcobranca/formatacao_string_spec.rb
brcobranca-7.3.0 spec/brcobranca/formatacao_string_spec.rb
brcobranca-7.2.2 spec/brcobranca/formatacao_string_spec.rb
brcobranca-7.2.1 spec/brcobranca/formatacao_string_spec.rb
brcobranca-7.2.0 spec/brcobranca/formatacao_string_spec.rb
brcobranca-7.1.0 spec/brcobranca/formatacao_string_spec.rb
brcobranca-7.0.0 spec/brcobranca/formatacao_string_spec.rb