spec/egn/generator_spec.rb in egn-1.3.1 vs spec/egn/generator_spec.rb in egn-1.3.2
- old
+ new
@@ -20,11 +20,11 @@
end
context "invoked with arguments" do
it "generates a new EGN considering the given options" do
- number = Egn::Generator.generate(year: 1990, month: 12, day: 30, sex: :male)
+ number = Egn::Generator.generate(year: 1990, month: 12, day: 30, gender: :male)
egn = Egn::Egn.new(number)
expect(egn).to be_valid
end
@@ -56,26 +56,26 @@
end
end
it "generates female EGNs" do
- number = Egn::Generator.generate(sex: :female)
+ number = Egn::Generator.generate(gender: :female)
egn = Egn::Egn.new(number)
- expect(egn.sex).to eq(:female)
+ expect(egn.gender).to eq(:female)
end
it "generates male EGNs" do
- number = Egn::Generator.generate(sex: :male)
+ number = Egn::Generator.generate(gender: :male)
egn = Egn::Egn.new(number)
- expect(egn.sex).to eq(:male)
+ expect(egn.gender).to eq(:male)
end
it "validates the options" do
- options = {year: 1960, month: 6, day: 3, sex: :male, region: 333}
+ options = {year: 1960, month: 6, day: 3, gender: :male, region: 333}
Egn::Generator.any_instance.should_receive(:validate!)
Egn::Generator.generate(options)
end
@@ -101,12 +101,12 @@
expect{
Egn::Generator.generate(day: 33)
}.to raise_error ArgumentError
end
- it "raises an exception if invalid sex is given" do
+ it "raises an exception if invalid gender is given" do
expect{
- Egn::Generator.generate(sex: :none)
+ Egn::Generator.generate(gender: :none)
}.to raise_error ArgumentError
end
end