Sha256: 643e7a183c2a5b96086b5e28aa6c14ee310ab91424896f40e31fa892fa52cf4c

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

require_relative '../spec_helper' # Use the RSpec framework
require_relative '../support/factory_atomic'
require_relative '../../lib/mini_kraken/core/log_var'

# Load the class under test
require_relative '../../lib/mini_kraken/core/association'

module MiniKraken
  module Core
    describe Association do
      include MiniKraken::FactoryAtomic # Use mix-in module

      let(:pea) { k_symbol(:pea) }
      subject { Association.new('q', pea) }

      context 'Initialization:' do
        it 'should be initialized with a name and a value' do
          expect { Association.new('q', pea) }.not_to raise_error
        end

        it 'should be initialized with a variable and a value' do
          expect { Association.new(LogVar.new('p'), pea) }.not_to raise_error
        end

        it 'should know the variable name' do
          expect(subject.i_name).to eq('q')
        end

        it 'should know the associated value' do
          expect(subject.value).to eq(pea)
        end
      end # context

      context 'Provided services:' do
      end # context
    end # describe
  end # module
end # module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mini_kraken-0.2.04 spec/core/association_spec.rb