turn 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.9.2 / 2012-02-08
2
+ * Fix colorization config issue.
3
+ * Switch to simple dotruby build system.
4
+
1
5
  == 0.9.1 / 2012-02-01
2
6
  * MiniTest Only
3
7
  * Fix issues with 1.8.7 support.
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # TURN - Test::Unit Reporter (New)
1
+ # TURN - MiniTest Reporters
2
2
  by Tim Pease
3
3
  http://codeforpeople.rubyforge.org/turn
4
4
 
5
5
  ## DESCRIPTION:
6
6
 
7
- TURN is a new way to view Test::Unit results. With longer running tests, it
7
+ TURN is a new way to view test results. With longer running tests, it
8
8
  can be very frustrating to see a failure (....F...) and then have to wait till
9
9
  all the tests finish before you can see what the exact failure was. TURN
10
10
  displays each test on a separate line with failures being displayed
@@ -74,7 +74,7 @@ Simply require the TURN package from within your test suite.
74
74
 
75
75
  $ require 'turn'
76
76
 
77
- This will configure Test::Unit to use TURN formatting for displaying test
77
+ This will configure MiniTest to use TURN formatting for displaying test
78
78
  restuls. A better line to use, though, is the following:
79
79
 
80
80
  begin; require 'turn'; rescue LoadError; end
@@ -105,7 +105,7 @@ Thankfully there is a work around. In your Gemfile add:
105
105
 
106
106
  The `:require` option will prevent Turn from trying to autorun tests.
107
107
 
108
- In the future we will change turn to use `reuqire 'turn/autorun'` instead,
108
+ In the future we will change turn to use `require 'turn/autorun'` instead,
109
109
  but that will require a lot of people to update a lot of tests, so it's not
110
110
  something to do lightly. Full change over will wait until the 1.0 release.
111
111
  In the mean time Turn will just put out a warning.
data/Version.txt CHANGED
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.9.2
data/lib/turn/autoload.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # This is a "dirty trick" to load `test/unit` or `minitest/unit` if sought.
2
2
  # Eventually a way to handle this more robustly (without autoreload)
3
3
  # should be worked out. But how?
4
- #autoload "Test", 'test/unit'
5
- #autoload "MiniTest", 'minitest/unit'
4
+ autoload "Test", 'test/unit'
5
+ autoload "MiniTest", 'minitest/unit'
6
6
 
data/lib/turn/colorize.rb CHANGED
@@ -16,19 +16,27 @@ module Turn
16
16
  #
17
17
  module Colorize
18
18
 
19
+ def self.included(base)
20
+ base.module_eval do
21
+ const_set :PASS, Colorize.pass('PASS')
22
+ const_set :FAIL, Colorize.fail('FAIL')
23
+ const_set :ERROR, Colorize.error('ERROR')
24
+ const_set :SKIP, Colorize.skip('SKIP')
25
+ end
26
+ end
27
+
19
28
  COLORLESS_TERMINALS = ['dumb']
20
29
 
30
+ # Colorize output or not?
21
31
  def self.colorize?
32
+ return @colorize unless @colorize.nil?
22
33
  @colorize ||= (
23
34
  ansi = Turn.config.ansi?
24
- if ansi.nil?
25
- color_supported?
26
- else
27
- Turn.config.ansi?
28
- end
35
+ ansi.nil? ? color_supported? : ansi
29
36
  )
30
37
  end
31
38
 
39
+ # Does the system support color?
32
40
  def self.color_supported?
33
41
  return false unless defined?(::ANSI::Code)
34
42
  return false unless $stdout.tty?
@@ -74,11 +82,6 @@ module Turn
74
82
  colorize? ? ::ANSI::Code.cyan{ string } : string
75
83
  end
76
84
 
77
- PASS = pass('PASS')
78
- FAIL = fail('FAIL')
79
- ERROR = error('ERROR')
80
- SKIP = skip('SKIP')
81
-
82
85
  def colorize?
83
86
  Colorize.colorize?
84
87
  end
data/lib/turn/command.rb CHANGED
@@ -4,32 +4,38 @@ require 'turn'
4
4
  module Turn
5
5
 
6
6
  # Turn - Pretty Unit Test Runner for Ruby
7
- #
7
+ #
8
8
  # SYNOPSIS
9
- # turn [OPTIONS] [RUN MODE] [OUTPUT MODE] [test globs...]
10
- #
11
- # OPTIONS
12
- # -h --help display this help information
13
- # --live don't use loadpath
14
- # --log log results to a file
15
- # -n --name=PATTERN only run tests that match regexp PATTERN
16
- # -c --case=PATTERN only run testcases that match regexp PATTERN
17
- # -I --loadpath=PATHS add given PATHS to the $LOAD_PATH
18
- # -r --requires=LIBS require given LIBS before running tests
19
- # -b --backtrace=INT Set the number of lines to show in backtrace.
20
- #
9
+ # turn [OPTIONS] [RUN MODE] [OUTPUT MODE] [TEST GLOBS ...]
10
+ #
11
+ # GENERAL OPTIONS
12
+ # -I, --loadpath=PATHS add paths to $LOAD_PATH
13
+ # -r, --require=LIBS require libraries
14
+ # -n, --name=PATTERN only run tests that match PATTERN
15
+ # -c, --case=PATTERN only run test cases that match PATTERN
16
+ # -b, --backtrace, --trace INT Limit the number of lines of backtrace.
17
+ # --natural Show natualized test names.
18
+ # --[no-]ansi Force use of ANSI codes on or off.
19
+ # --log log results to a file
20
+ # --live do not use local load path
21
+ #
21
22
  # RUN MODES
22
- # --normal run all tests in a single process [default]
23
- # --solo run each test in a separate process
24
- # --cross run each pair of test files in a separate process
25
- #
23
+ # --normal run all tests in a single process [default]
24
+ # --solo run each test in a separate process
25
+ # --cross run each pair of test files in a separate process
26
+ #
26
27
  # OUTPUT MODES
27
- # -O --outline turn's original case/test outline mode [default]
28
- # -P --progress indicates progress with progress bar
29
- # -D --dotted test/unit's traditonal dot-progress mode
30
- # -R --pretty new pretty reporter
31
- # -M --marshal dump output as YAML (normal run mode only)
32
- # -C --cue interactive testing
28
+ # -O, --outline turn's original case/test outline mode [default]
29
+ # -P, --progress indicates progress with progress bar
30
+ # -D, --dotted test-unit's traditonal dot-progress mode
31
+ # -R, -T, --pretty new pretty output mode
32
+ # -C, --cue cue for action on each failure/error
33
+ # -M, --marshal dump output as YAML (normal run mode only)
34
+ #
35
+ # COMMAND OPTIONS
36
+ # --debug turn debug mode on
37
+ # --version display version
38
+ # -h, --help display this help information
33
39
  #
34
40
  class Command
35
41
 
@@ -57,10 +57,22 @@ module Turn
57
57
  # Use natural language case names.
58
58
  attr_accessor :natural
59
59
 
60
- def verbose? ; @verbose ; end
61
- def live? ; @live ; end
62
- def natural? ; @natural ; end
63
- def ansi? ; @ansi ; end
60
+ #
61
+ def verbose?
62
+ @verbose
63
+ end
64
+
65
+ def live?
66
+ @live
67
+ end
68
+
69
+ def natural?
70
+ @natural
71
+ end
72
+
73
+ def ansi?
74
+ @ansi
75
+ end
64
76
 
65
77
  private
66
78
 
@@ -83,7 +95,7 @@ module Turn
83
95
  @pattern ||= /.*/
84
96
  @natural ||= false
85
97
  @trace ||= environment_trace
86
- @ansi ||= nil
98
+ @ansi ||= environment_ansi
87
99
 
88
100
  @files = nil # reset files just in case
89
101
  end
@@ -192,6 +204,18 @@ module Turn
192
204
  (ENV['backtrace'] ? ENV['backtrace'].to_i : nil)
193
205
  end
194
206
 
207
+ #
208
+ def environment_ansi
209
+ case ENV['ansi']
210
+ when 'true','yes','on'
211
+ true
212
+ when 'false','no','off'
213
+ false
214
+ else
215
+ nil
216
+ end
217
+ end
218
+
195
219
  end
196
220
 
197
221
  end
data/lib/turn/minitest.rb CHANGED
@@ -1,12 +1,16 @@
1
1
  # make sure latest verison is used, rather than ruby's built-in
2
- begin; gem 'minitest'; rescue Exception; end
2
+ begin
3
+ gem 'minitest'
4
+ rescue Exception
5
+ warn "gem install minitest"
6
+ end
3
7
 
4
8
  # we save the developer the trouble of having to load these (TODO: should we?)
5
9
  require 'minitest/unit'
6
10
  require 'minitest/spec'
7
11
 
8
12
  # compatability with old Test::Unit
9
- Test = MiniTest unless defined?(Test)
13
+ #Test = MiniTest unless defined?(Test)
10
14
 
11
15
  # load Turn's minitest runner
12
16
  require 'turn/runners/minirunner'
data/lib/turn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Turn
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.2"
3
3
  end
data/test/helper.rb CHANGED
@@ -6,6 +6,7 @@ require 'fileutils'
6
6
  if RUBY_VERSION < "1.9"
7
7
  require 'test/unit'
8
8
  else
9
+ gem 'minitest'
9
10
  require 'minitest/unit'
10
11
  require 'test/unit'
11
12
  end
@@ -21,9 +21,12 @@ if RUBY_VERSION >= '1.9'
21
21
  term, stdout = ENV['TERM'], $stdout
22
22
  host_os, ansicon, = ::RbConfig::CONFIG['host_os'], ENV['ANSICON']
23
23
  $stdout = $stdout.dup
24
- def $stdout.tty?
25
- true
26
- end
24
+
25
+ verbose, debug = $VERBOSE, $DEBUG
26
+ $VERBOSE, $DEBUG = false, false
27
+ def $stdout.tty? ; true ; end
28
+ $VERBOSE, $DEBUG = verbose, debug
29
+
27
30
  ENV['ANSICON'] = nil
28
31
  ENV['TERM'] = 'xterm'
29
32
  assert_equal true, Turn::Colorize.color_supported?
@@ -39,9 +42,12 @@ if RUBY_VERSION >= '1.9'
39
42
  assert_equal false, Turn::Colorize.color_supported?
40
43
  end
41
44
  ENV['TERM'] = 'xterm'
42
- def $stdout.tty?
43
- false
44
- end
45
+
46
+ verbose, debug = $VERBOSE, $DEBUG
47
+ $VERBOSE, $DEBUG = false, false
48
+ def $stdout.tty? ; false ; end
49
+ $VERBOSE, $DEBUG = verbose, debug
50
+
45
51
  assert_equal false, Turn::Colorize.color_supported?
46
52
  ensure
47
53
  ENV['TERM'], $stdout = term, stdout
@@ -70,7 +76,7 @@ if RUBY_VERSION >= '1.9'
70
76
  def test_ruby19_minitest_mocking
71
77
  setup_testunit
72
78
  result = turn 'tmp/test.rb'
73
- assert result.index('PASS')
79
+ assert result.index('PASS'), "RESULT:\n#{result}"
74
80
  end
75
81
 
76
82
  #def test_ruby19_minitest_mocking_force
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
+ - Thomas Sawyer
8
9
  - Tim Pease
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2012-02-02 00:00:00.000000000 Z
13
+ date: 2012-02-08 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: ansi
16
- requirement: &15635820 !ruby/object:Gem::Requirement
17
+ requirement: &14008240 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ! '>='
@@ -21,21 +22,10 @@ dependencies:
21
22
  version: '0'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *15635820
25
+ version_requirements: *14008240
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: minitest
27
- requirement: &15635380 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: *15635380
36
- - !ruby/object:Gem::Dependency
37
- name: bones-git
38
- requirement: &15634880 !ruby/object:Gem::Requirement
28
+ requirement: &14007520 !ruby/object:Gem::Requirement
39
29
  none: false
40
30
  requirements:
41
31
  - - ! '>='
@@ -43,56 +33,46 @@ dependencies:
43
33
  version: '0'
44
34
  type: :development
45
35
  prerelease: false
46
- version_requirements: *15634880
36
+ version_requirements: *14007520
47
37
  - !ruby/object:Gem::Dependency
48
- name: bones
49
- requirement: &15634400 !ruby/object:Gem::Requirement
38
+ name: rake
39
+ requirement: &14006980 !ruby/object:Gem::Requirement
50
40
  none: false
51
41
  requirements:
52
42
  - - ! '>='
53
43
  - !ruby/object:Gem::Version
54
- version: 3.7.3
44
+ version: '0'
55
45
  type: :development
56
46
  prerelease: false
57
- version_requirements: *15634400
58
- description: ''
59
- email: tim.pease@gmail.com
47
+ version_requirements: *14006980
48
+ description: Turn provides a set of alternative runners for MiniTest, both colorful
49
+ and informative.
50
+ email:
51
+ - transfire@gmail.com
52
+ - tim.pease@gmail.com
60
53
  executables:
61
54
  - turn
62
55
  extensions: []
63
56
  extra_rdoc_files:
64
- - History.txt
65
- - LICENSE-GPL2.txt
66
57
  - LICENSE-MIT.txt
67
- - LICENSE-RUBY.txt
68
- - LICENSE.txt
69
58
  - Release.txt
59
+ - LICENSE.txt
70
60
  - Version.txt
71
- - bin/turn
72
- files:
73
- - .gitignore
74
- - .travis.yml
75
- - Gemfile
76
- - History.txt
77
- - LICENSE-GPL2.txt
78
- - LICENSE-MIT.txt
79
61
  - LICENSE-RUBY.txt
80
- - LICENSE.txt
62
+ - LICENSE-GPL2.txt
63
+ - History.txt
81
64
  - README.md
82
- - Rakefile
83
- - Release.txt
84
- - Version.txt
65
+ files:
85
66
  - bin/turn
86
- - lib/turn.rb
87
67
  - lib/turn/autoload.rb
88
68
  - lib/turn/autorun.rb
89
69
  - lib/turn/bin.rb
90
70
  - lib/turn/colorize.rb
91
71
  - lib/turn/command.rb
92
- - lib/turn/components.rb
93
72
  - lib/turn/components/case.rb
94
73
  - lib/turn/components/method.rb
95
74
  - lib/turn/components/suite.rb
75
+ - lib/turn/components.rb
96
76
  - lib/turn/configuration.rb
97
77
  - lib/turn/controller.rb
98
78
  - lib/turn/core_ext.rb
@@ -112,6 +92,7 @@ files:
112
92
  - lib/turn/runners/testrunner.rb
113
93
  - lib/turn/testunit.rb
114
94
  - lib/turn/version.rb
95
+ - lib/turn.rb
115
96
  - test/helper.rb
116
97
  - test/runner
117
98
  - test/test_framework.rb
@@ -122,13 +103,19 @@ files:
122
103
  - try/test_counts.rb
123
104
  - try/test_sample.rb
124
105
  - try/test_sample2.rb
125
- - turn.gemspec
126
- homepage: http://gemcutter.org/gems/turn
127
- licenses: []
128
- post_install_message:
129
- rdoc_options:
130
- - --main
106
+ - LICENSE-MIT.txt
107
+ - Release.txt
108
+ - LICENSE.txt
109
+ - Version.txt
131
110
  - README.md
111
+ - LICENSE-RUBY.txt
112
+ - LICENSE-GPL2.txt
113
+ - History.txt
114
+ homepage: http://rubygems.org/gems/turn
115
+ licenses:
116
+ - MIT
117
+ post_install_message:
118
+ rdoc_options: []
132
119
  require_paths:
133
120
  - lib
134
121
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -144,12 +131,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
131
  - !ruby/object:Gem::Version
145
132
  version: '0'
146
133
  requirements: []
147
- rubyforge_project: turn
134
+ rubyforge_project:
148
135
  rubygems_version: 1.8.11
149
136
  signing_key:
150
137
  specification_version: 3
151
- summary: Test::Unit Reporter (New) -- new output format for Test::Unit
152
- test_files:
153
- - test/test_reporters.rb
154
- - test/test_framework.rb
155
- - test/test_runners.rb
138
+ summary: Test Reporters (New) -- new output formats for Testing
139
+ test_files: []
140
+ has_rdoc:
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- coverage
2
- doc
3
- pkg
4
- tmp
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- rvm:
2
- - 1.8.6
3
- - 1.8.7 # (current default)
4
- - 1.9.2
5
- - rbx
6
- - rbx-2.0
7
- - ree
8
- - jruby
9
- - ruby-head
10
-
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source :rubygems
2
- gemspec
data/Rakefile DELETED
@@ -1,40 +0,0 @@
1
- begin
2
- require 'bones'
3
- rescue LoadError
4
- abort '### please install the "bones" gem ###'
5
- end
6
-
7
- task :default => 'test'
8
-
9
- Bones {
10
- name 'turn'
11
- summary 'Test::Unit Reporter (New) -- new output format for Test::Unit'
12
- authors 'Tim Pease'
13
- email 'tim.pease@gmail.com'
14
- url 'http://gemcutter.org/gems/turn'
15
- version File.read('Version.txt').strip
16
- ignore_file '.gitignore'
17
-
18
- exclude << '^work'
19
- rdoc.exclude << '^lib'
20
-
21
- use_gmail
22
-
23
- depend_on 'ansi'
24
- depend_on 'minitest'
25
- depend_on 'bones-git', :development => true
26
- }
27
-
28
- # Might be useful one day, so we'll leave it here.
29
- #
30
- # Rake::TaskManager.class_eval do
31
- # def remove_task(task_name)
32
- # @tasks.delete(task_name.to_s)
33
- # end
34
- # end
35
- #
36
- # def remove_task(task_name)
37
- # Rake.application.remove_task(task_name)
38
- # end
39
-
40
- # EOF
data/turn.gemspec DELETED
@@ -1,40 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{turn}
5
- s.version = "0.8.3.2"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = [%q{Tim Pease}]
9
- s.date = %q{2011-10-26}
10
- s.description = %q{}
11
- s.email = %q{tim.pease@gmail.com}
12
- s.executables = [%q{turn}]
13
- s.extra_rdoc_files = [%q{History.txt}, %q{NOTICE.txt}, %q{Release.txt}, %q{Version.txt}, %q{bin/turn}, %q{license/GPLv2.txt}, %q{license/MIT-LICENSE.txt}, %q{license/RUBY-LICENSE.txt}]
14
- s.files = [%q{.travis.yml}, %q{Gemfile}, %q{History.txt}, %q{NOTICE.txt}, %q{README.md}, %q{Rakefile}, %q{Release.txt}, %q{Version.txt}, %q{bin/turn}, %q{demo/test_autorun_minitest.rb}, %q{demo/test_autorun_testunit.rb}, %q{demo/test_counts.rb}, %q{demo/test_sample.rb}, %q{demo/test_sample2.rb}, %q{lib/turn.rb}, %q{lib/turn/autoload.rb}, %q{lib/turn/autorun/minitest.rb}, %q{lib/turn/autorun/minitest0.rb}, %q{lib/turn/autorun/testunit.rb}, %q{lib/turn/autorun/testunit0.rb}, %q{lib/turn/bin.rb}, %q{lib/turn/colorize.rb}, %q{lib/turn/command.rb}, %q{lib/turn/components/case.rb}, %q{lib/turn/components/method.rb}, %q{lib/turn/components/suite.rb}, %q{lib/turn/controller.rb}, %q{lib/turn/core_ext.rb}, %q{lib/turn/reporter.rb}, %q{lib/turn/reporters/cue_reporter.rb}, %q{lib/turn/reporters/dot_reporter.rb}, %q{lib/turn/reporters/marshal_reporter.rb}, %q{lib/turn/reporters/outline_reporter.rb}, %q{lib/turn/reporters/pretty_reporter.rb}, %q{lib/turn/reporters/progress_reporter.rb}, %q{lib/turn/runners/crossrunner.rb}, %q{lib/turn/runners/isorunner.rb}, %q{lib/turn/runners/loadrunner.rb}, %q{lib/turn/runners/minirunner.rb}, %q{lib/turn/runners/solorunner.rb}, %q{lib/turn/runners/testrunner.rb}, %q{lib/turn/version.rb}, %q{license/GPLv2.txt}, %q{license/MIT-LICENSE.txt}, %q{license/RUBY-LICENSE.txt}, %q{test/helper.rb}, %q{test/runner}, %q{test/test_framework.rb}, %q{test/test_reporters.rb}, %q{test/test_runners.rb}, %q{turn.gemspec}]
15
- s.homepage = %q{http://gemcutter.org/gems/turn}
16
- s.rdoc_options = [%q{--main}, %q{README.md}]
17
- s.require_paths = [%q{lib}]
18
- s.rubyforge_project = %q{turn}
19
- s.rubygems_version = %q{1.8.6}
20
- s.summary = %q{Test::Unit Reporter (New) -- new output format for Test::Unit}
21
- s.test_files = [%q{test/test_framework.rb}, %q{test/test_reporters.rb}, %q{test/test_runners.rb}]
22
-
23
- if s.respond_to? :specification_version then
24
- s.specification_version = 3
25
-
26
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
- s.add_runtime_dependency(%q<ansi>, [">= 0"])
28
- s.add_development_dependency(%q<bones-git>, [">= 1.2.4"])
29
- s.add_development_dependency(%q<bones>, [">= 3.7.1"])
30
- else
31
- s.add_dependency(%q<ansi>, [">= 0"])
32
- s.add_dependency(%q<bones-git>, [">= 1.2.4"])
33
- s.add_dependency(%q<bones>, [">= 3.7.1"])
34
- end
35
- else
36
- s.add_dependency(%q<ansi>, [">= 0"])
37
- s.add_dependency(%q<bones-git>, [">= 1.2.4"])
38
- s.add_dependency(%q<bones>, [">= 3.7.1"])
39
- end
40
- end