Method: Saki::GeneralHelpers::ClassMethods#with_existing

Defined in:
lib/saki.rb

#with_existing(resource, opts = {}, &block) ⇒ Object



106
107
108
109
110
111
112
113
# File 'lib/saki.rb', line 106

def with_existing resource, opts={}, &block
  context "with exisiting #{resource}" do
    before do
      instance_variable_set "@#{resource}", default_factory(resource, opts)
    end
    module_eval &block
  end
end