Sha256: 50972388ee7d4c91e14f2cf196e3c5b95eca0a9558400615265ca317fc8790bd

Contents?: true

Size: 740 Bytes

Versions: 6

Compression:

Stored size: 740 Bytes

Contents

require 'spec_helper'

describe SmartIoC::Container do
  before :all do
    SmartIoC.clear

    dir_path = File.join(File.expand_path(File.dirname(__FILE__)), 'example/admins')
    SmartIoC.find_package_beans(:admins, dir_path)

    dir_path = File.join(File.expand_path(File.dirname(__FILE__)), 'example/utils')
    SmartIoC.find_package_beans(:utils, dir_path)

    dir_path = File.join(File.expand_path(File.dirname(__FILE__)), 'example/users')
    SmartIoC.find_package_beans(:users, dir_path)

    @container = SmartIoC.container
  end

  it 'loads recursive beans' do
    users_creator = @container.get_bean(:users_creator)
    uc2 = users_creator.send(:repository).send(:users_creator)
    expect(users_creator).to eq(uc2)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
smart_ioc-0.5.2 spec/smart_ioc/recursive_spec.rb
smart_ioc-0.5.1 spec/smart_ioc/recursive_spec.rb
smart_ioc-0.5.0 spec/smart_ioc/recursive_spec.rb
smart_ioc-0.3.9 spec/smart_ioc/recursive_spec.rb
smart_ioc-0.3.8 spec/smart_ioc/recursive_spec.rb
smart_ioc-0.3.7 spec/smart_ioc/recursive_spec.rb