Sha256: 0ce96981a7dedd130002d52721395e7d35d0fd233d1cdca33f8f0c2ff0c3345b

Contents?: true

Size: 540 Bytes

Versions: 3

Compression:

Stored size: 540 Bytes

Contents

require 'spec_helper'

module BoletoBancario
  module Calculos
    describe Digitos do
      (0..9).each do |number|
        it "should return self when is #{number}" do
          Digitos.new(number).sum.should eq number
        end
      end

      { 11 => 2, '18' => 9, 99 => 18, '58' => 13, 112 => 4, '235' => 10 }.each do |number, expecting|
        it "should sum the sum of the digits when is '#{number}', expecting to be '#{expecting}'" do
          Digitos.new(number).sum.should eq expecting
        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/digitos_spec.rb
conectiva-boleto_bancario-0.0.2.beta spec/boleto_bancario/calculos/digitos_spec.rb
boleto_bancario-0.0.1.beta spec/boleto_bancario/calculos/digitos_spec.rb