Sha256: d3f403078cfe85d44cef721d2ce45e2d1b467ee60442547a9ed2c87502923bdf

Contents?: true

Size: 511 Bytes

Versions: 3

Compression:

Stored size: 511 Bytes

Contents

require 'spec_helper'

describe BrDanfe::DanfeLib::Phone do
  describe '.format' do
    context 'when phone have 10 digits' do
      it 'returns a formated phone' do
        phone = '1234567890'
        expect(BrDanfe::DanfeLib::Phone.format(phone)).to eq '(12) 3456-7890'
      end
    end

    context 'when phone have 11 digits' do
      it 'returns a formated phone' do
        phone = '12345678901'
        expect(BrDanfe::DanfeLib::Phone.format(phone)).to eq '(12) 34567-8901'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
br_danfe-0.12.1 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.12.0 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.11.2 spec/lib/danfe_lib/phone_spec.rb