spec/ie/go_spec.rb in br_documents-0.0.10 vs spec/ie/go_spec.rb in br_documents-0.0.11
- old
+ new
@@ -1,40 +1,43 @@
require "spec_helper"
+require_relative "shared_examples_for_to_remove_all_masks"
describe BrDocuments::IE::GO do
describe "#formatted" do
it "returns a formatted ie" do
- ie = BrDocuments::IE::GO.new("123456789")
+ ie = described_class.new("123456789")
expect(ie.formatted).to eq "12.345.678-9"
end
end
describe "#valid?" do
it "is invalid with malformed number" do
["01.390415.9", "280541-600", "1C78150A5"].each do |number|
- ie = BrDocuments::IE::GO.new(number)
+ ie = described_class.new(number)
expect(ie).to_not be_valid
end
end
it "is invalid with length different to 9" do
["1234567", "122345678901"].each do |number|
- ie = BrDocuments::IE::GO.new(number)
+ ie = described_class.new(number)
expect(ie).to_not be_valid
end
end
it "is invalid with invalid check number" do
["903473566", "493184742"].each do |number|
- ie = BrDocuments::IE::GO.new(number)
+ ie = described_class.new(number)
expect(ie).to_not be_valid
end
end
it "is valid with valid number" do
["155432214", "916876470"].each do |number|
- ie = BrDocuments::IE::GO.new(number)
+ ie = described_class.new(number)
expect(ie).to be_valid
end
end
+
+ include_examples "for to remove all masks", "91.687.647-0"
end
end