spec/zenlish/lex/lexeme_spec.rb in zenlish-0.2.05 vs spec/zenlish/lex/lexeme_spec.rb in zenlish-0.2.06

- old
+ new

@@ -8,29 +8,29 @@ module Zenlish module Lex describe Lexeme do include Feature::FeatureStructDefBearer - + let(:a_wclass) { WClasses::CommonNoun.new } let(:a_lemma) { 'people' } let(:an_entry) { LexicalEntry.new(a_lemma) } - let(:a_feat_struct_def) { + let(:a_feat_struct_def) do { 'NUMBER' => enumeration(:plural), 'PARADIGM' => [identifier, 'Plural_only'] } - } + end - subject { Lexeme.new(a_wclass, an_entry) } + subject { Lexeme.new(a_wclass, an_entry) } context 'Initialization:' do it 'could be initialized with a word class and a lexical entry' do expect { Lexeme.new(a_wclass, an_entry) }.not_to raise_error end - + it 'could be initialized with a w. class, lexical ent., feature hash' do expect { Lexeme.new(a_wclass, an_entry, a_feat_struct_def) }.not_to raise_error - end + end it 'should know its word class' do expect(subject.wclass).to eq(a_wclass) end @@ -42,23 +42,22 @@ context 'Provided services:' do subject { Lexeme.new(a_wclass, an_entry, a_feat_struct_def) } it 'should know its lemma' do expect(subject.lemma).to eq(a_lemma) end - + it 'should know its own feature defs' do - instance = Lexeme.new(a_wclass, an_entry, a_feat_struct_def) + instance = Lexeme.new(a_wclass, an_entry, a_feat_struct_def) expect(instance['NUMBER'].default.val).to eq(:plural) end - + it 'should know its inflection paradigm' do expect(subject.paradigm).to be_kind_of(Inflect::InflectionTable) end - + it 'should know all its inflections' do expect(subject.all_inflections).to eq(['people']) - end + end end # context end # describe end # module end # module -