Sha256: 5373cce83959f60bd41e50711bea5f5dece0c2d9f1b2ca565a3767b19375fec4

Contents?: true

Size: 656 Bytes

Versions: 2

Compression:

Stored size: 656 Bytes

Contents

require 'spec_helper'

describe CodiceFiscale::Codes do
  describe '#month_letter' do
    context 'the given number is greater than 0 and less than 12' do
      it 'return a letter' do
        1.upto(12).each do |n|
          expect(subject.month_letter(1)).to match /^[A-Z]{1,}$/
        end
      end
    end

    context 'the given number is greater than 12' do
      it 'return nil' do
        expect(subject.month_letter(13)).to be_nil
      end
    end

    context 'the given number is less than 1' do
      it 'return nil' do
        -1.upto(0).each do |n|
          expect(subject.month_letter(n)).to be_nil
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
codice-fiscale-1.0.1 spec/lib/codice_fiscale/codes_spec.rb
codice-fiscale-1.0.0 spec/lib/codice_fiscale/codes_spec.rb