Sha256: aed3a8daefba8fe720808830d7ed5e5f0254ff9373ec15abd8ba4c4c8084218a

Contents?: true

Size: 954 Bytes

Versions: 9

Compression:

Stored size: 954 Bytes

Contents

require "spec_helper"
require_relative "shared_examples_for_to_remove_all_masks"

describe BrDocuments::IE::PR do
  describe "#formatted" do
    it "returns a formatted ie" do
      ie = described_class.new("1234567890")
      expect(ie.formatted).to eq "12345678-90"
    end
  end

  describe "#valid?" do
    it "is invalid with malformed number" do
      ["1016323-850", "10163238.50"].each do |number|
        ie = described_class.new(number)
        expect(ie).to_not be_valid
      end
    end

    it "is invalid with invalid check number" do
      ["10163238-51", "10163238-40"].each do |number|
        ie = described_class.new(number)
        expect(ie).to_not be_valid
      end
    end

    it "is valid with valid number" do
      ["1016323850", "10163238-50"].each do |number|
        ie = described_class.new(number)
        expect(ie).to be_valid
      end
    end

    include_examples "for to remove all masks", "10163238-50"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
br_documents-0.1.3 spec/ie/pr_spec.rb
br_documents-0.1.2 spec/ie/pr_spec.rb
br_documents-0.1.1 spec/ie/pr_spec.rb
br_documents-0.1.0 spec/ie/pr_spec.rb
br_documents-0.0.15 spec/ie/pr_spec.rb
br_documents-0.0.14 spec/ie/pr_spec.rb
br_documents-0.0.13 spec/ie/pr_spec.rb
br_documents-0.0.12 spec/ie/pr_spec.rb
br_documents-0.0.11 spec/ie/pr_spec.rb