Included Modules

Class Index [+]

Quicksearch

Cucumber::Formatter::Console

This module contains helper methods that are used by formatters that print output to the terminal.

Constants

FORMATS

Public Instance Methods

announce(announcement) click to toggle source

define @delayed_announcements = [] in your Formatter if you want to activate this feature

     # File lib/cucumber/formatter/console.rb, line 134
134:       def announce(announcement)
135:         if @delayed_announcements
136:           @delayed_announcements << announcement
137:         else
138:           if @io
139:             @io.puts
140:             @io.puts(format_string(announcement, :tag))
141:             @io.flush
142:           end
143:         end
144:       end
embed(file, mime_type) click to toggle source
     # File lib/cucumber/formatter/console.rb, line 128
128:       def embed(file, mime_type)
129:         # no-op
130:       end
empty_announcements() click to toggle source
     # File lib/cucumber/formatter/console.rb, line 163
163:       def empty_announcements
164:         @delayed_announcements = []
165:       end
format_step(keyword, step_match, status, source_indent) click to toggle source
    # File lib/cucumber/formatter/console.rb, line 16
16:       def format_step(keyword, step_match, status, source_indent)
17:         comment = if source_indent
18:           c = (' # ' + step_match.file_colon_line).indent(source_indent)
19:           format_string(c, :comment)
20:         else
21:           ''
22:         end
23: 
24:         format = format_for(status, :param)
25:         line = keyword + step_match.format_args(format) + comment
26:         format_string(line, status)
27:       end
format_string(string, status) click to toggle source
    # File lib/cucumber/formatter/console.rb, line 29
29:       def format_string(string, status)
30:         fmt = format_for(status)
31:         if Proc === fmt
32:           fmt.call(string)
33:         else
34:           fmt % string
35:         end
36:       end

Private Instance Methods

format_for(*keys) click to toggle source
     # File lib/cucumber/formatter/console.rb, line 169
169:       def format_for(*keys)
170:         key = keys.join('_').to_sym
171:         fmt = FORMATS[key]
172:         raise "No format for #{key.inspect}: #{FORMATS.inspect}" if fmt.nil?
173:         fmt
174:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.