Class: QAT::Formatter::Scenario::Name
- Inherits:
-
Object
- Object
- QAT::Formatter::Scenario::Name
- Includes:
- Cucumber::Formatter::Io
- Defined in:
- lib/qat/formatter/scenario/name.rb
Overview
Instance Method Summary collapse
- #after_features(features) ⇒ Object
-
#initialize(runtime, path_or_io, options) ⇒ Name
constructor
A new instance of Name.
- #scenario_name(keyword, name, file_colon_line, source_indent) ⇒ Object
Constructor Details
#initialize(runtime, path_or_io, options) ⇒ Name
Returns a new instance of Name.
10 11 12 13 14 15 16 17 |
# File 'lib/qat/formatter/scenario/name.rb', line 10 def initialize(runtime, path_or_io, ) @runtime = runtime @io = ensure_io(path_or_io) @to_file = (@io != $stdout) @options = @scenarios = {} @repeated = {} end |
Instance Method Details
#after_features(features) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/qat/formatter/scenario/name.rb', line 31 def after_features(features) if @to_file content = { scenarios: @scenarios, repeated: @repeated } @io.puts(content.to_json({ indent: ' ', space: ' ', object_nl: "\n" })) end end |
#scenario_name(keyword, name, file_colon_line, source_indent) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/qat/formatter/scenario/name.rb', line 19 def scenario_name(keyword, name, file_colon_line, source_indent) if @to_file if @scenarios.values.include?(name) @repeated[name] ||= [] @repeated[name] << file_colon_line end @scenarios[file_colon_line] = name else puts "#{name}: #{file_colon_line}" end end |