cucumber-formatters 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cucumber/formatter/failures.rb +41 -16
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: ccda781c9ad69ad83b2fbfb715ec6a94eda24c48
         | 
| 4 | 
            +
              data.tar.gz: 57bb066b286748eebcd3e655c59ca15b5842392d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b3a81391e13cbef1bcfa1da698a76dc052ad16bb4ff19a8bc0dab6f3f392fee444a502af2563f1335445e01f81f201ca7ec2d4ad10b1921083c60a2642df3ea0
         | 
| 7 | 
            +
              data.tar.gz: d1db8e3d1c6d776823ee2e186948624db82d423f01f38c794409771eb2edccb69e4db9dfb5f2607b5462a95edbaa4bd0028df7716558e9e4b5dc45cbd8d092e6
         | 
| @@ -29,39 +29,64 @@ module Cucumber | |
| 29 29 | 
             
                    @io.flush
         | 
| 30 30 | 
             
                  end
         | 
| 31 31 |  | 
| 32 | 
            +
                  def after_features(features)
         | 
| 33 | 
            +
                    print_summary(features)
         | 
| 34 | 
            +
                  end
         | 
| 35 | 
            +
             | 
| 32 36 | 
             
                  def before_feature(feature)
         | 
| 33 | 
            -
                    @ | 
| 37 | 
            +
                    @background_failure = false
         | 
| 34 38 | 
             
                  end
         | 
| 35 39 |  | 
| 36 | 
            -
                  def  | 
| 37 | 
            -
                    @ | 
| 38 | 
            -
                    @scenario = "  Scenario: #{feature_element.title}"
         | 
| 40 | 
            +
                  def feature_name(keyword, name)
         | 
| 41 | 
            +
                    @feature = "#{keyword}: #{name}"
         | 
| 39 42 | 
             
                  end
         | 
| 40 43 |  | 
| 41 | 
            -
                  def  | 
| 42 | 
            -
                    @ | 
| 44 | 
            +
                  def before_background(background)
         | 
| 45 | 
            +
                    @in_background = true
         | 
| 43 46 | 
             
                  end
         | 
| 44 47 |  | 
| 45 | 
            -
                  def  | 
| 46 | 
            -
                    @ | 
| 47 | 
            -
                    print_scenario_summary
         | 
| 48 | 
            -
                    print_exception(exception, status, 6)
         | 
| 49 | 
            -
                    @io.puts
         | 
| 50 | 
            -
                    @io.flush
         | 
| 48 | 
            +
                  def after_background(background)
         | 
| 49 | 
            +
                    @in_background = false
         | 
| 51 50 | 
             
                  end
         | 
| 52 51 |  | 
| 53 | 
            -
                  def  | 
| 54 | 
            -
                     | 
| 52 | 
            +
                  def background_name(keyword, name, file_colon_line, source_indent)
         | 
| 53 | 
            +
                    @background = "  #{keyword}: #{name}"
         | 
| 54 | 
            +
                  end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                  def scenario_name(keyword, name, file_colon_line, source_indent)
         | 
| 57 | 
            +
                    @scenario = "  #{keyword}: #{name}"
         | 
| 58 | 
            +
                  end
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                  def step_name(keyword, step_match, status, source_indent, background, file_colon_line)
         | 
| 61 | 
            +
                    @step = "    #{keyword}#{step_match.format_args}"
         | 
| 62 | 
            +
                  end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                  def exception(exception, status, indent = 6)
         | 
| 65 | 
            +
                    unless @background_failure
         | 
| 66 | 
            +
                      print_scenario_summary
         | 
| 67 | 
            +
                      print_exception(exception, status, indent)
         | 
| 68 | 
            +
                      @io.puts
         | 
| 69 | 
            +
                      @io.flush
         | 
| 70 | 
            +
                    end
         | 
| 71 | 
            +
                    @background_failure = @in_background
         | 
| 72 | 
            +
                  end
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                  def after_table_row(table_row)
         | 
| 75 | 
            +
                    if table_row.exception
         | 
| 76 | 
            +
                      @step = "    Row: #{table_row.name}"
         | 
| 77 | 
            +
                      exception(table_row.exception, table_row.status, 6)
         | 
| 78 | 
            +
                    end
         | 
| 55 79 | 
             
                  end
         | 
| 56 80 |  | 
| 57 81 | 
             
                  private
         | 
| 58 82 |  | 
| 59 83 | 
             
                  def print_scenario_summary
         | 
| 60 84 | 
             
                    @io.puts @feature unless @feature.nil?
         | 
| 61 | 
            -
                    @io.puts @scenario  | 
| 85 | 
            +
                    @io.puts (@scenario ? @scenario : @background)
         | 
| 62 86 | 
             
                    @io.puts @step unless @step.nil?
         | 
| 87 | 
            +
                    @io.puts @table_row unless @table_row.nil?
         | 
| 63 88 |  | 
| 64 | 
            -
                    @feature, @scenario, @step = nil, nil, nil
         | 
| 89 | 
            +
                    @feature, @background, @scenario, @step = nil, nil, nil, nil
         | 
| 65 90 | 
             
                  end
         | 
| 66 91 |  | 
| 67 92 | 
             
                  def print_summary(features)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cucumber-formatters
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ben Slaughter
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-10- | 
| 11 | 
            +
            date: 2014-10-27 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: yard
         |