Sha256: fd8a6008de87ba0f2fc0508d565cc2e23552a425c4ad0f5314cbc5634318da42

Contents?: true

Size: 843 Bytes

Versions: 7

Compression:

Stored size: 843 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("SOÇIEDADE,  BRASI@?!+-_LEIR'\"A DE ZÔÔLOGIA 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-9.2.2 spec/brcobranca/formatacao_string_spec.rb
brcobranca-9.2.1 spec/brcobranca/formatacao_string_spec.rb
brcobranca-9.2.0 spec/brcobranca/formatacao_string_spec.rb
brcobranca-9.1.2 spec/brcobranca/formatacao_string_spec.rb
brcobranca-9.1.1 spec/brcobranca/formatacao_string_spec.rb
brcobranca-9.1.0 spec/brcobranca/formatacao_string_spec.rb
brcobranca-9.0.0 spec/brcobranca/formatacao_string_spec.rb