Sha256: 1deaec422ba985ae0f098e32e254cc02c405d70c289ec14656ae1cc6c9767d00

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true
require_relative '../../spec_helper' # Use the RSpec framework
require_relative '../support/var2word'
require_relative '../../../lib/zenlish/parser/zparser' # Load the class under test

module Zenlish
  module Parser
    describe ZParser do
      include Var2Word
      
      subject { ZParser.new }

      context 'Initialization:' do
        it 'should be initialized without argument' do
          expect { ZParser.new }.not_to raise_error
        end
      end # context

      context 'Producing parse tree or forest:' do
        # it 'should produce trees (for non ambiguous input)' do
          # # OK, non-ambiguous sentence: "Lisa sees Tony."
          # literals = [lisa, sees, tony, dot]
          # result_type = Rley::PTree::ParseTree
          # expect(subject.to_pforest(literals)).to be_kind_of(result_type)
        # end

        it 'should produce forest' do
          # Sentence: "Lisa sees Tony."
          literals = [lisa, sees, tony, dot]
          result_type = Rley::SPPF::ParseForest
          expect(subject.to_pforest(literals)).to be_kind_of(result_type)
        end
      end # context
    end # describe
  end # module
end # module

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zenlish-0.2.05 spec/zenlish/parser/zparser_spec.rb
zenlish-0.2.04 spec/zenlish/parser/zparser_spec.rb
zenlish-0.2.03 spec/zenlish/parser/zparser_spec.rb
zenlish-0.2.02 spec/zenlish/parser/zparser_spec.rb
zenlish-0.2.01 spec/zenlish/parser/zparser_spec.rb
zenlish-0.2.00 spec/zenlish/parser/zparser_spec.rb
zenlish-0.1.25 spec/zenlish/parser/zparser_spec.rb
zenlish-0.1.24 spec/zenlish/parser/zparser_spec.rb