Sha256: 90ed12b0b8b47e3a34dd528dc718417939d0232e95476fae7d0d8338d0d5976f
Contents?: true
Size: 1.34 KB
Versions: 2
Compression:
Stored size: 1.34 KB
Contents
require 'spec_helper' describe Object do before :all do SmartIoC.clear end describe '::inject' do before :all do class TestClass include SmartIoC::Iocify bean :test_class, package: :test, context: :test inject :config inject :logger, ref: :test_logger end @test_class = TestClass.allocate end it {expect(@test_class.private_methods.include?(:config)).to eq(true) } it {expect(@test_class.private_methods.include?(:logger)).to eq(true) } end describe '::bean' do before :all do class BeanClass include SmartIoC::Iocify bean :my_bean, scope: :request, package: :my_package, instance: false, factory_method: :my_method, context: :test end @bean_definition = SmartIoC.find_bean_definition(:my_bean, :my_package, :test) end it { expect(@bean_definition.name).to eq(:my_bean) } it { expect(@bean_definition.package).to eq(:my_package) } it { expect(@bean_definition.path).to match(/object_spec.rb/) } it { expect(@bean_definition.klass).to eq(BeanClass) } it { expect(@bean_definition.scope).to eq(:request) } it { expect(@bean_definition.instance).to eq(false) } it { expect(@bean_definition.factory_method).to eq(:my_method) } it { expect(@bean_definition.context).to eq(:test) } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
smart_ioc-0.5.2 | spec/smart_ioc/object_spec.rb |
smart_ioc-0.5.1 | spec/smart_ioc/object_spec.rb |