Sha256: a04741a1c6e0ea800c565ab0ca5efc7434417a95b59cdb5bf0d450cd97d6d760

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 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
  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.21 spec/smart_ioc/bean_file_loader_spec.rb
smart_ioc-0.1.20 spec/smart_ioc/bean_file_loader_spec.rb