Class: AssemblyLine::GenericContext

Inherits:
Object
  • Object
show all
Defined in:
lib/assembly_line/generic_context.rb

Instance Method Summary collapse

Instance Method Details

#before(scope = :each, &block) ⇒ Object

there are no tests so just run the block



12
13
14
# File 'lib/assembly_line/generic_context.rb', line 12

def before(scope=:each, &block)
  instance_eval &block
end

#clearObject



16
17
18
19
20
# File 'lib/assembly_line/generic_context.rb', line 16

def clear
  instance_variables.each do |name|
    instance_variable_set(name, nil)
  end
end

#let(name, &block) ⇒ Object



4
5
6
7
8
9
# File 'lib/assembly_line/generic_context.rb', line 4

def let(name, &block)
  define_method name do
    let_values[name] ||= instance_eval(&block)
  end
  AssemblyLine.def_delegator :generic_context, name
end