Module: CucumberGrowler

Includes:
RSpactor::Growl
Included in:
Cucumber::Formatter::Console
Defined in:
lib/cucumber_growler.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Methods included from RSpactor::Growl

#image_path, #notify

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cucumber_growler.rb', line 8

def self.included(base)
  base.class_eval do
    alias original_print_stats print_stats
    include InstanceMethods

    def print_stats(features, profiles = [])
      title, icon, messages = '', '', []
      [:failed, :skipped, :undefined, :pending, :passed].reverse.each do |status|
        if step_mother.steps(status).any?
          icon = icon_for(status)
          # title = title_for(status)
          messages << dump_count(step_mother.steps(status).length, "step", status.to_s)
        end
      end

      notify "Cucumber Results", messages.reverse.join(", "), icon
      original_print_stats(features, profiles = [])
    end
  end
end