Sha256: 96cc73f099e16941ebfb6d397a0f9789dba641cd9653ee94d0c597e3827b5208

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

require 'spec_helper'

describe SmartIoC::BeanFileLoader 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)

    @container = SmartIoC::Container.get_instance
  end

  it 'requires beans only once' do
    repository = @container.get_bean(:repository, package: :admins, context: :test)
    repository = @container.get_bean(:repository, package: :admins, context: :test)
    expect(repository.get(1)).to eq(nil)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smart_ioc-0.1.19 spec/smart_ioc/bean_file_loader_spec.rb
smart_ioc-0.1.18 spec/smart_ioc/bean_file_loader_spec.rb