Sha256: ada7a3731def2b9450867942c78e4b0f90dca068a51c56bd08f9eca190deac66

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require_relative '../../spec_helper' # Use the RSpec framework
require_relative '../../../lib/zenlish/wclasses/verb' # Load the class under test

module Zenlish
  module WClasses
    class Verb
      # Do limited monkeypatching, just for testing purposes
      def init_paradigms
        # Empty method
      end
    end

    describe Verb do
      subject { Verb.new }

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

      context 'Provided services:' do
        it 'should know that it has inflected forms' do
          expect(subject).not_to be_invariable
        end

        it 'should know its feature definitions' do
          expect(subject['NUMBER']).to be_kind_of(Feature::FeatureDef)
          expect(subject['PERSON']).to be_kind_of(Feature::FeatureDef)
          expect(subject['PARADIGM'].default.val).to eq('Regular_inflection')
        end
      end # context
    end # describe
  end # module
end # module

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zenlish-0.2.06 spec/zenlish/wclasses/verb_spec.rb
zenlish-0.2.05 spec/zenlish/wclasses/verb_spec.rb
zenlish-0.2.04 spec/zenlish/wclasses/verb_spec.rb