tconsole 1.1.2pre2 → 1.1.2pre3
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.
- data/README.md +1 -1
- data/lib/tconsole/console.rb +2 -1
- data/lib/tconsole/minitest_handler.rb +25 -16
- data/lib/tconsole/server.rb +11 -4
- data/lib/tconsole/test_result.rb +1 -1
- data/lib/tconsole/version.rb +1 -1
- metadata +6 -6
    
        data/README.md
    CHANGED
    
    | @@ -6,7 +6,7 @@ concerning what tests to run, and see their test output. It's also got a | |
| 6 6 | 
             
            helpful reload command for when your Rails environment needs to be
         | 
| 7 7 | 
             
            restarted.
         | 
| 8 8 |  | 
| 9 | 
            -
            TConsole should work in pretty much any Unix environment and will work with apps running Ruby 1. | 
| 9 | 
            +
            TConsole should work in pretty much any Unix environment and will work with apps running Ruby 1.9. It can be run on pretty much any test suite that uses MiniTest, including Rails test suites.
         | 
| 10 10 |  | 
| 11 11 | 
             
            See it in Action
         | 
| 12 12 | 
             
            ------
         | 
    
        data/lib/tconsole/console.rb
    CHANGED
    
    
| @@ -116,25 +116,34 @@ module TConsole | |
| 116 116 | 
             
                end
         | 
| 117 117 |  | 
| 118 118 | 
             
                def status(io = self.output)
         | 
| 119 | 
            -
                  format = "%d tests, %d assertions, "
         | 
| 120 119 |  | 
| 121 | 
            -
                   | 
| 122 | 
            -
             | 
| 123 | 
            -
             | 
| 120 | 
            +
                  if test_count == 0
         | 
| 121 | 
            +
                    if !match_patterns.empty?
         | 
| 122 | 
            +
                      puts ::Term::ANSIColor.yellow("No tests were executed because no tests matching `#{match_patterns.join(", ")}` were found.")
         | 
| 123 | 
            +
                    else
         | 
| 124 | 
            +
                      puts ::Term::ANSIColor.yellow("No tests were executed.")
         | 
| 125 | 
            +
                    end
         | 
| 126 | 
            +
                  else
         | 
| 127 | 
            +
                    format = "%d tests, %d assertions, "
         | 
| 128 | 
            +
             | 
| 129 | 
            +
                    format << COLOR_MAP["P"] if passes > 0
         | 
| 130 | 
            +
                    format << "%d passes, "
         | 
| 131 | 
            +
                    format << ::Term::ANSIColor.reset if passes > 0
         | 
| 124 132 |  | 
| 125 | 
            -
             | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 133 | 
            +
                    format << COLOR_MAP["F"] if failures > 0
         | 
| 134 | 
            +
                    format << "%d failures, "
         | 
| 135 | 
            +
                    format << ::Term::ANSIColor.reset if failures > 0
         | 
| 128 136 |  | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 137 | 
            +
                    format << COLOR_MAP["E"] if errors > 0
         | 
| 138 | 
            +
                    format << "%d errors, "
         | 
| 139 | 
            +
                    format << ::Term::ANSIColor.reset if errors > 0
         | 
| 132 140 |  | 
| 133 | 
            -
             | 
| 134 | 
            -
             | 
| 135 | 
            -
             | 
| 141 | 
            +
                    format << COLOR_MAP["S"] if skips > 0
         | 
| 142 | 
            +
                    format << "%d skips"
         | 
| 143 | 
            +
                    format << ::Term::ANSIColor.reset if skips > 0
         | 
| 136 144 |  | 
| 137 | 
            -
             | 
| 145 | 
            +
                    io.puts format % [test_count, assertion_count, passes, failures, errors, skips]
         | 
| 146 | 
            +
                  end
         | 
| 138 147 | 
             
                end
         | 
| 139 148 |  | 
| 140 149 | 
             
                def _run_suite(suite, type)
         | 
| @@ -161,7 +170,7 @@ module TConsole | |
| 161 170 | 
             
                    end
         | 
| 162 171 |  | 
| 163 172 | 
             
                    if skip
         | 
| 164 | 
            -
                       | 
| 173 | 
            +
                      nil
         | 
| 165 174 | 
             
                    else
         | 
| 166 175 | 
             
                      inst = suite.new method
         | 
| 167 176 | 
             
                      inst._assertions = 0
         | 
| @@ -202,7 +211,7 @@ module TConsole | |
| 202 211 | 
             
                    end
         | 
| 203 212 | 
             
                  end
         | 
| 204 213 |  | 
| 205 | 
            -
                  return assertions.size, assertions.inject(0) { |sum, n| sum + n }
         | 
| 214 | 
            +
                  return assertions.select { |n| !n.nil? }.size, assertions.inject(0) { |sum, n| n.nil? ? sum + 0 : sum + n }
         | 
| 206 215 | 
             
                end
         | 
| 207 216 |  | 
| 208 217 | 
             
                def puke(klass, meth, e)
         | 
    
        data/lib/tconsole/server.rb
    CHANGED
    
    | @@ -108,8 +108,8 @@ module TConsole | |
| 108 108 | 
             
                    end
         | 
| 109 109 |  | 
| 110 110 | 
             
                    if paths.length == 0
         | 
| 111 | 
            -
                      puts "No test files match your requested test set: #{globs.join(",")}."
         | 
| 112 | 
            -
                      puts "Skipping execution."
         | 
| 111 | 
            +
                      puts ::Term::ANSIColor.yellow("No test files match your requested test set: #{globs.join(",")}.")
         | 
| 112 | 
            +
                      puts ::Term::ANSIColor.yellow("Skipping execution.")
         | 
| 113 113 | 
             
                      return nil
         | 
| 114 114 | 
             
                    end
         | 
| 115 115 |  | 
| @@ -211,10 +211,17 @@ module TConsole | |
| 211 211 | 
             
                  puts
         | 
| 212 212 |  | 
| 213 213 | 
             
                  if sorted_timings.length == 0
         | 
| 214 | 
            -
                    puts "No timing data available. Be sure you've run some tests."
         | 
| 214 | 
            +
                    puts ::Term::ANSIColor.red + "No timing data available. Be sure you've run some tests." + ::Term::ANSIColor.reset
         | 
| 215 215 | 
             
                  else
         | 
| 216 216 | 
             
                    sorted_timings.reverse[0, limit].each do |timing|
         | 
| 217 | 
            -
                       | 
| 217 | 
            +
                      output = "#{"%0.6f" % timing[:time]}s #{timing[:name]}"
         | 
| 218 | 
            +
                      if timing[:time] > 1
         | 
| 219 | 
            +
                        print ::Term::ANSIColor.red, output, ::Term::ANSIColor.reset
         | 
| 220 | 
            +
                      else
         | 
| 221 | 
            +
                        print ::Term::ANSIColor.green, output, ::Term::ANSIColor.reset
         | 
| 222 | 
            +
                      end
         | 
| 223 | 
            +
             | 
| 224 | 
            +
                      print ::Term::ANSIColor.magenta, " #{last_result.elements[timing[:name]]}", ::Term::ANSIColor.reset, "\n"
         | 
| 218 225 | 
             
                    end
         | 
| 219 226 | 
             
                  end
         | 
| 220 227 |  | 
    
        data/lib/tconsole/test_result.rb
    CHANGED
    
    
    
        data/lib/tconsole/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: tconsole
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.1. | 
| 4 | 
            +
              version: 1.1.2pre3
         | 
| 5 5 | 
             
              prerelease: 5
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,11 +9,11 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2012- | 
| 12 | 
            +
            date: 2012-05-16 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: term-ansicolor
         | 
| 16 | 
            -
              requirement: & | 
| 16 | 
            +
              requirement: &70265082683240 !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                none: false
         | 
| 18 18 | 
             
                requirements:
         | 
| 19 19 | 
             
                - - ~>
         | 
| @@ -21,10 +21,10 @@ dependencies: | |
| 21 21 | 
             
                    version: 1.0.7
         | 
| 22 22 | 
             
              type: :runtime
         | 
| 23 23 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements: * | 
| 24 | 
            +
              version_requirements: *70265082683240
         | 
| 25 25 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 26 26 | 
             
              name: minitest
         | 
| 27 | 
            -
              requirement: & | 
| 27 | 
            +
              requirement: &70265082682460 !ruby/object:Gem::Requirement
         | 
| 28 28 | 
             
                none: false
         | 
| 29 29 | 
             
                requirements:
         | 
| 30 30 | 
             
                - - ~>
         | 
| @@ -32,7 +32,7 @@ dependencies: | |
| 32 32 | 
             
                    version: 2.11.0
         | 
| 33 33 | 
             
              type: :runtime
         | 
| 34 34 | 
             
              prerelease: false
         | 
| 35 | 
            -
              version_requirements: * | 
| 35 | 
            +
              version_requirements: *70265082682460
         | 
| 36 36 | 
             
            description: ! "    tconsole allows Rails developers to easily and quickly run their
         | 
| 37 37 | 
             
              tests as a whole or in subsets. It forks the testing processes from\n    a preloaded
         | 
| 38 38 | 
             
              test environment to ensure that developers don't have to reload their entire Rails
         |