Class: Micron::Runner::Clazz

Inherits:
Object
  • Object
show all
Includes:
Debug
Defined in:
lib/micron/runner/clazz.rb,
lib/micron/runner/clazz19.rb

Direct Known Subclasses

ParallelClazz

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Debug

#debug

Constructor Details

#initialize(clazz, file, method_patterns) ⇒ Clazz

Returns a new instance of Clazz.



10
11
12
13
14
# File 'lib/micron/runner/clazz.rb', line 10

def initialize(clazz, file, method_patterns)
  @name = clazz.to_s
  @file = file
  @methods = test_methods(method_patterns).map { |m| Method.new(self, m) }
end

Instance Attribute Details

#methodsObject (readonly)

Returns the value of attribute methods.



8
9
10
# File 'lib/micron/runner/clazz.rb', line 8

def methods
  @methods
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/micron/runner/clazz.rb', line 8

def name
  @name
end

Instance Method Details

#createObject

Create a new instance of the Class represented by this object



17
18
19
# File 'lib/micron/runner/clazz.rb', line 17

def create
  name_to_const.new
end

#runObject



21
22
23
24
25
26
27
# File 'lib/micron/runner/clazz.rb', line 21

def run
  methods.each do |method|
    Micron.runner.report(:start_method, method)
    method.run
    Micron.runner.report(:end_method, method)
  end
end