class TallyAction

Attributes

counter[R]

Public Class Methods

new() click to toggle source
# File lib/mspec/runner/actions/tally.rb, line 73
def initialize
  @counter = Tally.new
end

Public Instance Methods

example(state, block) click to toggle source

Callback for the MSpec :example event. Increments the tally of examples.

# File lib/mspec/runner/actions/tally.rb, line 109
def example(state, block)
  @counter.examples!
end
exception(exception) click to toggle source

Callback for the MSpec :exception event. Increments the tally of errors and failures.

# File lib/mspec/runner/actions/tally.rb, line 103
def exception(exception)
  exception.failure? ? @counter.failures! : @counter.errors!
end
expectation(state) click to toggle source

Callback for the MSpec :expectation event. Increments the tally of expectations (e.g. should, should_receive, etc.).

# File lib/mspec/runner/actions/tally.rb, line 97
def expectation(state)
  @counter.expectations!
end
format() click to toggle source
# File lib/mspec/runner/actions/tally.rb, line 113
def format
  @counter.format
end
load() click to toggle source
# File lib/mspec/runner/actions/tally.rb, line 91
def load
  @counter.files!
end
register() click to toggle source
# File lib/mspec/runner/actions/tally.rb, line 77
def register
  MSpec.register :load,        self
  MSpec.register :exception,   self
  MSpec.register :example,     self
  MSpec.register :expectation, self
end
unregister() click to toggle source
# File lib/mspec/runner/actions/tally.rb, line 84
def unregister
  MSpec.unregister :load,        self
  MSpec.unregister :exception,   self
  MSpec.unregister :example,     self
  MSpec.unregister :expectation, self
end