Sha256: 86eaf16bfa54326d7fcdc7e092a66f523c9541af2a1ea1bdde79329d979f064d

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

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

# Load the class under test
require_relative '../../../lib/zenlish/wclasses/irregular_verb_extension'

module Zenlish
  module WClasses
    describe IrregularVerbExtension do
      subject do
        obj = Object.new
        obj.extend(IrregularVerbExtension)
        obj.init_extension(obj)
        obj
      end

      context 'Initialization:' do
        it 'should mix-in with a host object' do
          expect { Object.new.extend(IrregularVerbExtension) }.not_to raise_error
        end

        it 'should inject an instance variable' do
          expect(subject.instance_variable_get(:@forms)).to be_kind_of(Array)
        end
      end # context

      context 'Provided services:' do
        it 'should provide a write accessor' do
          subject.forms past_simple: 'chose', past_participle: 'chosen'
          expect(subject.past_simple).to eq('chose')
          expect(subject.past_participle).to eq('chosen')
        end
      end # context
    end # describe
  end # module
end # module

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zenlish-0.2.06 spec/zenlish/wclasses/irregular_verb_extension_spec.rb
zenlish-0.2.05 spec/zenlish/wclasses/irregular_verb_extension_spec.rb
zenlish-0.2.04 spec/zenlish/wclasses/irregular_verb_extension_spec.rb
zenlish-0.2.03 spec/zenlish/wclasses/irregular_verb_extension_spec.rb
zenlish-0.2.02 spec/zenlish/wclasses/irregular_verb_extension_spec.rb