Sha256: 54a6bf7d44b238c0a528ff65b2426b249f1f531a4d1337def18b9e929f2031fb

Contents?: true

Size: 938 Bytes

Versions: 3

Compression:

Stored size: 938 Bytes

Contents

require 'spec_helper'

module BoletoBancario
  module Calculos
    describe Modulo11FatorDe2a9RestoZero do
      describe "#calculate" do
        context "with a one number digit" do
          subject { Modulo11FatorDe2a9RestoZero.new(6) }

          it { should eq '0' }
        end

        context "with a two number digit" do
          subject { Modulo11FatorDe2a9RestoZero.new(100) }

          it { should eq '7' }
        end

        context "with a three number digit" do
          subject { Modulo11FatorDe2a9RestoZero.new(1004) }

          it { should eq '9' }
        end

        context "with a three number digit that returns zero" do
          subject { Modulo11FatorDe2a9RestoZero.new(1088) }

          it { should eq '0' }
        end

        context "when mod division return '10'" do
          subject { Modulo11FatorDe2a9RestoZero.new(1073) }

          it { should eq '1' }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
boleto_bancario-0.0.2 spec/boleto_bancario/calculos/modulo11_fator_de2a9_resto_zero_spec.rb
conectiva-boleto_bancario-0.0.2.beta spec/boleto_bancario/calculos/modulo11_fator_de2a9_resto_zero_spec.rb
boleto_bancario-0.0.1.beta spec/boleto_bancario/calculos/modulo11_fator_de2a9_resto_zero_spec.rb