Module: Viiite::Unit

Included in:
Benchmark, NTimes, Suite
Defined in:
lib/viiite/unit.rb

Defined Under Namespace

Classes: Enum

Instance Method Summary (collapse)

Instance Method Details

- (Object) run(extra = nil, reporter = nil, &block)



4
5
6
7
8
9
10
11
12
# File 'lib/viiite/unit.rb', line 4

def run(extra = nil, reporter = nil, &block)
  extra, reporter = {}, extra unless extra.is_a?(Hash)
  reporter ||= block
  if reporter
    dup._run(extra, reporter)
  else
    to_enum(extra)
  end
end

- (Object) to_enum(extra = {})



14
15
16
# File 'lib/viiite/unit.rb', line 14

def to_enum(extra = {})
  Enum.new(self, extra)
end