Module: RubyBeans::Stub

Defined in:
lib/ruby_beans/stub.rb

Instance Method Summary collapse

Instance Method Details

#stub_bean(name, obj) ⇒ Object



3
4
5
# File 'lib/ruby_beans/stub.rb', line 3

def stub_bean(name, obj)
  RubyBeans::Cache.put(name, obj)
end

#stub_container(&block) ⇒ Object



7
8
9
# File 'lib/ruby_beans/stub.rb', line 7

def stub_container(&block)
  Class.new RubyBeans::Container, &block
end

#stub_main_container(&block) ⇒ Object



11
12
13
14
# File 'lib/ruby_beans/stub.rb', line 11

def stub_main_container(&block)
  klass = stub_container(&block)
  RubyBeans.main_container = klass
end