minitest-colorin 0.1.0 → 0.1.1
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/minitest/colorin.rb +22 -22
 - data/lib/minitest/colorin/version.rb +1 -1
 - data/lib/minitest/colorin_plugin.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 4be2babd8a4657b6eac9494b001ce702cf2ac577
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 6e5fa7d415e0a4339c6f8519008c13b9850f9fd9
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: c59474a5bb16bc83613008bc93d1ee8fe1d495b40844f24fc9aaaaeadb1a17a0d044fca739648f7c4472bf84faa8889c7f12dfcd5dbf06e32883605d41388cdf
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a70e1c202d2f3e987be2513f2609fcda6ba4b222534a20717959778f0f30ea06749cd7c7e6e26ad8104c6b29720169b6bb87be16959fa5db2b02f7b625f91715
         
     | 
    
        data/lib/minitest/colorin.rb
    CHANGED
    
    | 
         @@ -62,20 +62,21 @@ module Minitest 
     | 
|
| 
       62 
62 
     | 
    
         | 
| 
       63 
63 
     | 
    
         
             
                  if test_id.context != @previous_context
         
     | 
| 
       64 
64 
     | 
    
         
             
                    io.puts
         
     | 
| 
       65 
     | 
    
         
            -
                    io.puts  
     | 
| 
      
 65 
     | 
    
         
            +
                    io.puts ::Colorin.white(test_id.context).bold
         
     | 
| 
       66 
66 
     | 
    
         
             
                    @previous_context = test_id.context
         
     | 
| 
       67 
67 
     | 
    
         
             
                  end
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
     | 
    
         
            -
                  label = colorin(LABELS[result.result_code] 
     | 
| 
       70 
     | 
    
         
            -
                  number =  
     | 
| 
       71 
     | 
    
         
            -
                  time =  
     | 
| 
       72 
     | 
    
         
            -
                   
     | 
| 
       73 
     | 
    
         
            -
                    when ' 
     | 
| 
       74 
     | 
    
         
            -
                    when 'F' then colorin( 
     | 
| 
      
 69 
     | 
    
         
            +
                  label = colorin(LABELS[result.result_code], GROUPS[result.result_code])
         
     | 
| 
      
 70 
     | 
    
         
            +
                  number = ::Colorin.dark(test_id.number)
         
     | 
| 
      
 71 
     | 
    
         
            +
                  time = ::Colorin.dark("(#{result.time.round(3)}s)")
         
     | 
| 
      
 72 
     | 
    
         
            +
                  message = case result.result_code
         
     | 
| 
      
 73 
     | 
    
         
            +
                    when 'S' then colorin(result.failures[0].message, :skips) 
         
     | 
| 
      
 74 
     | 
    
         
            +
                    when 'F' then colorin(relative_path(result.failures[0].location), :failures)
         
     | 
| 
      
 75 
     | 
    
         
            +
                    when 'E' then colorin(error_message(result), :errors)
         
     | 
| 
       75 
76 
     | 
    
         
             
                    else nil
         
     | 
| 
       76 
77 
     | 
    
         
             
                  end
         
     | 
| 
       77 
78 
     | 
    
         | 
| 
       78 
     | 
    
         
            -
                  io.puts "  #{label}  #{number} #{test_id.name} #{time} #{ 
     | 
| 
      
 79 
     | 
    
         
            +
                  io.puts "  #{label}  #{number} #{test_id.name} #{time} #{message}"
         
     | 
| 
       79 
80 
     | 
    
         
             
                end
         
     | 
| 
       80 
81 
     | 
    
         | 
| 
       81 
82 
     | 
    
         
             
                def passed?
         
     | 
| 
         @@ -117,26 +118,25 @@ module Minitest 
     | 
|
| 
       117 
118 
     | 
    
         
             
                end
         
     | 
| 
       118 
119 
     | 
    
         | 
| 
       119 
120 
     | 
    
         
             
                def print_detail_of(group)
         
     | 
| 
       120 
     | 
    
         
            -
                  color = COLORS[group]
         
     | 
| 
       121 
121 
     | 
    
         
             
                  group_results = send group
         
     | 
| 
       122 
122 
     | 
    
         | 
| 
       123 
123 
     | 
    
         
             
                  if group_results.any?
         
     | 
| 
       124 
     | 
    
         
            -
                    io.puts colorin(group.to_s.upcase).bold.underline 
     | 
| 
      
 124 
     | 
    
         
            +
                    io.puts colorin(group.to_s.upcase, group).bold.underline
         
     | 
| 
       125 
125 
     | 
    
         
             
                    group_results.each_with_index do |r,i| 
         
     | 
| 
       126 
126 
     | 
    
         
             
                      test_id = TestID.new r
         
     | 
| 
       127 
127 
     | 
    
         
             
                      number = "#{i+1}) "
         
     | 
| 
       128 
128 
     | 
    
         
             
                      indent = ' ' * number.size
         
     | 
| 
       129 
129 
     | 
    
         
             
                      io.puts "#{number}#{test_id.context} > #{test_id.name}"
         
     | 
| 
       130 
130 
     | 
    
         
             
                      if group == :errors
         
     | 
| 
       131 
     | 
    
         
            -
                        io.puts colorin("#{indent}#{r.failures[0].exception.class}: #{r.failures[0].exception.message}") 
     | 
| 
      
 131 
     | 
    
         
            +
                        io.puts colorin("#{indent}#{r.failures[0].exception.class}: #{r.failures[0].exception.message}", group)
         
     | 
| 
       132 
132 
     | 
    
         
             
                        r.failures[0].backtrace.each do |line|
         
     | 
| 
       133 
     | 
    
         
            -
                          io.puts  
     | 
| 
      
 133 
     | 
    
         
            +
                          io.puts ::Colorin.dark("#{indent}#{relative_path(line)}")
         
     | 
| 
       134 
134 
     | 
    
         
             
                        end
         
     | 
| 
       135 
135 
     | 
    
         
             
                      else
         
     | 
| 
       136 
136 
     | 
    
         
             
                        r.failures[0].message.split("\n").each do |line|
         
     | 
| 
       137 
     | 
    
         
            -
                          io.puts colorin("#{indent}#{line}") 
     | 
| 
      
 137 
     | 
    
         
            +
                          io.puts colorin("#{indent}#{line}", group)
         
     | 
| 
       138 
138 
     | 
    
         
             
                        end
         
     | 
| 
       139 
     | 
    
         
            -
                        io.puts  
     | 
| 
      
 139 
     | 
    
         
            +
                        io.puts ::Colorin.dark("#{indent}#{relative_path(r.failures[0].location)}")
         
     | 
| 
       140 
140 
     | 
    
         
             
                      end
         
     | 
| 
       141 
141 
     | 
    
         
             
                      io.puts if i < group_results.count - 1
         
     | 
| 
       142 
142 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -146,12 +146,12 @@ module Minitest 
     | 
|
| 
       146 
146 
     | 
    
         | 
| 
       147 
147 
     | 
    
         
             
                def print_summary
         
     | 
| 
       148 
148 
     | 
    
         
             
                  summary = [
         
     | 
| 
       149 
     | 
    
         
            -
                    colorin("#{results.count} tests" 
     | 
| 
       150 
     | 
    
         
            -
                    colorin("#{passed.count} passed" 
     | 
| 
       151 
     | 
    
         
            -
                    colorin("#{failures.count} failures" 
     | 
| 
       152 
     | 
    
         
            -
                    colorin("#{errors.count} errors" 
     | 
| 
       153 
     | 
    
         
            -
                    colorin("#{skips.count} skips" 
     | 
| 
       154 
     | 
    
         
            -
                    colorin("#{assertions_count} assertions" 
     | 
| 
      
 149 
     | 
    
         
            +
                    colorin("#{results.count} tests", :tests),
         
     | 
| 
      
 150 
     | 
    
         
            +
                    colorin("#{passed.count} passed", :passed),
         
     | 
| 
      
 151 
     | 
    
         
            +
                    colorin("#{failures.count} failures", :failures),
         
     | 
| 
      
 152 
     | 
    
         
            +
                    colorin("#{errors.count} errors", :errors),
         
     | 
| 
      
 153 
     | 
    
         
            +
                    colorin("#{skips.count} skips", :skips),
         
     | 
| 
      
 154 
     | 
    
         
            +
                    colorin("#{assertions_count} assertions", :assertions),
         
     | 
| 
       155 
155 
     | 
    
         
             
                  ]
         
     | 
| 
       156 
156 
     | 
    
         | 
| 
       157 
157 
     | 
    
         
             
                  io.puts summary.join(', ')
         
     | 
| 
         @@ -171,8 +171,8 @@ module Minitest 
     | 
|
| 
       171 
171 
     | 
    
         
             
                  full_path.gsub "#{Dir.pwd}/", ''
         
     | 
| 
       172 
172 
     | 
    
         
             
                end
         
     | 
| 
       173 
173 
     | 
    
         | 
| 
       174 
     | 
    
         
            -
                def colorin(text)
         
     | 
| 
       175 
     | 
    
         
            -
                  ::Colorin. 
     | 
| 
      
 174 
     | 
    
         
            +
                def colorin(text, group)
         
     | 
| 
      
 175 
     | 
    
         
            +
                  ::Colorin.send COLORS[group], text
         
     | 
| 
       176 
176 
     | 
    
         
             
                end
         
     | 
| 
       177 
177 
     | 
    
         | 
| 
       178 
178 
     | 
    
         
             
              end
         
     |