Sha256: b27dbb6869a7d52295de7efaa01a56114aac2e409608e21d6c7b3fdba79d4c50

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

require_relative '../../spec_helper' # Use the RSpec framework
require_relative '../../../lib/zenlish/wclasses/all_word_classes'
require_relative '../../../lib/zenlish/lex/lexical_entry'
require_relative '../../../lib/zenlish/lex/lexeme'
require_relative '../../../lib/zenlish/lex/literal' # Load the class under test

module Zenlish
  module Lex
    describe Lexeme do
      let(:sample_wclass) { WClasses::CommonNoun.new }
      let(:sample_lemma) { 'thing' }
      let(:sample_entry) { LexicalEntry.new(sample_lemma) }
      let(:sample_position) { double('position') }
      let(:sample_lexeme) { Lexeme.new(sample_wclass, sample_entry)  }

      subject { Literal.new('things', sample_lexeme, sample_position) }

      context 'Initialization:' do
        it 'should be initialized with a string, a lexeme and a position' do
          expect { Literal.new('things', sample_lexeme, sample_position) }.not_to raise_error
        end
      end # context

      context 'Provided services:' do
        it 'should know its lexeme' do
          expect(subject.zlexeme).to eq(sample_lexeme)
        end
      end # context
    end # describe
  end # module
end # module

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zenlish-0.2.05 spec/zenlish/lex/literal_spec.rb
zenlish-0.2.04 spec/zenlish/lex/literal_spec.rb
zenlish-0.2.03 spec/zenlish/lex/literal_spec.rb
zenlish-0.2.02 spec/zenlish/lex/literal_spec.rb
zenlish-0.2.01 spec/zenlish/lex/literal_spec.rb
zenlish-0.2.00 spec/zenlish/lex/literal_spec.rb