Sha256: f4236a5e64e0ab17b63c5217a4c2b16fbc1a8c387e7ef481076256578d2d7d7a

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require_relative '../spec_helper' # Use the RSpec framework
require_relative '../../lib/mini_kraken/core/k_symbol'
require_relative '../../lib/mini_kraken/core/variable'

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

module MiniKraken
  module Core
    describe Association do
      let(:pea) {KSymbol.new(: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(Variable.new('p'), pea) }.not_to raise_error
        end        

        it 'should know the variable name' do
          expect(subject.var_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

3 entries across 3 versions & 1 rubygems

Version Path
mini_kraken-0.1.04 spec/core/association_spec.rb
mini_kraken-0.1.03 spec/core/association_spec.rb
mini_kraken-0.1.02 spec/core/association_spec.rb