spec/zenlish/wclasses/regular_verb_spec.rb in zenlish-0.2.04 vs spec/zenlish/wclasses/regular_verb_spec.rb in zenlish-0.2.05

- old
+ new

@@ -41,10 +41,16 @@ verb = build_verb(verb_form) pairs.each do |(constraints, expected_form)| expect(verb.inflect(constraints)).to eq(expected_form) end end + + def test_all_inflections(verb_form, wforms) + verb = build_verb(verb_form) + inflected = verb.all_inflections + expect(inflected.sort).to eq(wforms.sort) + end it 'should know how to inflect regular verbs' do expectations_1 = [ [present_1sg, 'exist'], [present_3sg, 'exists'], @@ -91,10 +97,24 @@ [present_1pl, 'die'], [progressive, 'dying'], [past_simple, 'died'], [past_participle, 'died'] ] - test_inflection_of('die', expectations_5) + test_inflection_of('die', expectations_5) + + expectations_6 = [ + [present_1sg, 'want'], + [present_3sg, 'wants'], + [present_1pl, 'want'], + [progressive, 'wanting'], + [past_simple, 'wanted'], + [past_participle, 'wanted'] + ] + test_inflection_of('want', expectations_6) + end + + it 'should give all word forms of a given verb' do + test_all_inflections('die', ['die', 'dies', 'dying', 'died']) end end # context end # describe end # module end # module \ No newline at end of file