spec/egn/egn_spec.rb in egn-1.2.2 vs spec/egn/egn_spec.rb in egn-1.3.0

- old
+ new

@@ -97,9 +97,25 @@ egn = Egn::Egn.new(male_egn) expect(egn.sex).to eq :male end end + it 'allows an option to be passed that changes the output to numbers' do + male = Egn.parse("0612318303") + female = Egn.parse("5202079211") + + expect(male.sex(format: :number)).to eq 1 + expect(female.sex(format: :number)).to eq 2 + end + + it 'allows an option to be passed that changes the output to a single char' do + male = Egn.parse("0612318303") + female = Egn.parse("5202079211") + + expect(male.sex(format: :char)).to eq 'm' + expect(female.sex(format: :char)).to eq 'f' + end + end end