spec/bankgiro_spec.rb in banktools-se-0.7.0 vs spec/bankgiro_spec.rb in banktools-se-0.8.0

- old
+ new

@@ -88,10 +88,14 @@ describe ".number_to_ocr" do it "adds a mod-10 check digit" do BankTools::SE::Bankgiro.number_to_ocr("123").should eq "1230" end + it "handles integer input" do + BankTools::SE::Bankgiro.number_to_ocr(123).should eq "1230" + end + it "can add an optional length digit" do BankTools::SE::Bankgiro.number_to_ocr("1234567890", length_digit: true).should eq "123456789023" end it "can pad the number" do @@ -104,9 +108,13 @@ end describe ".number_from_ocr" do it "strips the mod-10 check digit" do BankTools::SE::Bankgiro.number_from_ocr("1230").should eq "123" + end + + it "handles integer input" do + BankTools::SE::Bankgiro.number_from_ocr(1230).should eq "123" end it "can strip an optional length digit" do BankTools::SE::Bankgiro.number_from_ocr("123456789023", length_digit: true).should eq "1234567890" end