Sha256: 5934323890c208b00adac8bd9e1089c37de3b66513d24f99168e7e22b6601f3f

Contents?: true

Size: 511 Bytes

Versions: 27

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

27 entries across 27 versions & 1 rubygems

Version Path
br_danfe-0.11.1 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.11.0 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.10.1 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.10.0 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.8.0 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.7 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.6 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.5 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.4 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.3 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.2 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.1 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.7.0 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.6.1 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.6.0 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.5.2 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.5.1 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.5.0 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.4.3 spec/lib/danfe_lib/phone_spec.rb
br_danfe-0.4.2 spec/lib/danfe_lib/phone_spec.rb