Sha256: 2bd483cc64ebc2c5d37f4acdccf73c7b91e9a3965c2aea15b78f13ff6e37ea07

Contents?: true

Size: 393 Bytes

Versions: 3

Compression:

Stored size: 393 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class CPFFormatterTest < Minitest::Test
  test "formats strings without separators" do
    number = "12345678901"

    assert_equal "123.456.789-01", CPF::Formatter.format(number)
  end

  test "removes any non-numeric characters" do
    number = "\n12$345[678/901-"

    assert_equal "12345678901", CPF::Formatter.strip(number)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cpf_cnpj-1.0.1 test/cpf/formatter_test.rb
cpf_cnpj-1.0.0 test/cpf/formatter_test.rb
cpf_cnpj-0.6.0 test/cpf/formatter_test.rb