Sha256: ed5940aaf8df1279dd1612627f4f5593f21c967431ada8f7014fa13caf420896

Contents?: true

Size: 1.04 KB

Versions: 32

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require_relative '../../spec_helper' # Use the RSpec framework

# Load module under test
require_relative '../../../lib/zenlish/lex/empty_lexicon_factory'

module Zenlish
  module Lex
    describe EmptyLexiconFactory do
      subject do
        obj = Object.new
        obj.extend(EmptyLexiconFactory)
      end

      context 'Mix-in integration:' do
        it 'should acquire the methods of the mix-in module' do
          expect(subject.respond_to?(:create_empty_lexicon)).to be_truthy
        end
      end # context

      context 'Created lexicon:' do
        it 'should allow the creation of empty lexicon' do
          expect(subject.create_empty_lexicon).to be_kind_of(Lexicon)
        end

        it 'should initialize lexicon with terminal symbols of the language' do
          lexicon = subject.create_empty_lexicon
          found = lexicon.terminals.find { |symb| symb.kind_of?(WClasses::CommonNoun) }
          expect(found).to be_truthy
        end
      end # context
    end # describe
  end # module
end # module

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
zenlish-0.2.06 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.2.05 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.2.04 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.2.03 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.2.02 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.2.01 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.2.00 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.25 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.24 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.23 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.22 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.21 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.20 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.19 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.18 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.17 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.16 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.15 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.14 spec/zenlish/lex/empty_lexicon_factory_spec.rb
zenlish-0.1.13 spec/zenlish/lex/empty_lexicon_factory_spec.rb