spec/lib/codice_fiscale/codes_spec.rb in codice-fiscale-0.0.9 vs spec/lib/codice_fiscale/codes_spec.rb in codice-fiscale-1.0.0

- old
+ new

@@ -2,22 +2,26 @@ 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 - subject.month_letter(1).should == 'A' + 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 - subject.month_letter(13).should be_nil + expect(subject.month_letter(13)).to be_nil end end context 'the given number is less than 1' do it 'return nil' do - subject.month_letter(0).should be_nil + -1.upto(0).each do |n| + expect(subject.month_letter(n)).to be_nil + end end end end end \ No newline at end of file