Module: Busted::Countable

Included in:
Profiler::Default, Profiler::Sandwich
Defined in:
lib/busted/countable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#counterObject (readonly)

Returns the value of attribute counter.



4
5
6
# File 'lib/busted/countable.rb', line 4

def counter
  @counter
end

#report=(value) ⇒ Object (writeonly)

Sets the attribute report

Parameters:

  • value

    the value to set the attribute report to.



5
6
7
# File 'lib/busted/countable.rb', line 5

def report=(value)
  @report = value
end

Instance Method Details

#finish_counterObject



13
14
15
16
17
# File 'lib/busted/countable.rb', line 13

def finish_counter
  counter.finish

  report[:invalidations] = counter.report
end

#start_counterObject



7
8
9
10
11
# File 'lib/busted/countable.rb', line 7

def start_counter
  @counter ||= Counter.new

  counter.start
end