TwP-turn 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. data/History.txt +3 -0
  2. data/README.txt +4 -1
  3. data/Release.txt +10 -2
  4. data/VERSION +1 -1
  5. data/lib/turn.rb +16 -11
  6. data/turn.gemspec +1 -1
  7. metadata +1 -1
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.6.0 / 2009-05-30
2
+ * Testrunner @io renamed to @output for test/unit 2.
3
+
1
4
  == 0.5.1 / 2009-03-25
2
5
  * fixed a "convert nil into String" error
3
6
 
data/README.txt CHANGED
@@ -44,6 +44,9 @@ If you have the 'facets' gem installed, then TURN output will be displayed in
44
44
  wonderful technicolor (but only if your terminal supports ANSI color codes).
45
45
  Well, the only colors are green and red, but that is still color.
46
46
 
47
+ Note that the 'facets' gem is also required if you wish to use the
48
+ progressbar output mode.
49
+
47
50
  === Command Line
48
51
 
49
52
  You can use the *turn* executable in place of the *ruby* interpreter.
@@ -84,7 +87,7 @@ scipt. Now your Rails tests will use TURN formatting.
84
87
 
85
88
  == REQUIREMENTS:
86
89
 
87
- * facets 2.0+
90
+ * facets 2.0+ (for colorized output and progressbar output mode)
88
91
 
89
92
  == INSTALL:
90
93
 
data/Release.txt CHANGED
@@ -1,6 +1,14 @@
1
- = Turn 0.5
1
+ = Turn 0.6
2
2
 
3
- Turn has turned 0.5 with some signifficant new features.
3
+ Turn 0.6 is now compatible with Test/Unit 2.0.
4
+
5
+ A instance variable name change made between 1.x and 2.0 series
6
+ of test/unit prevent the Turn modified Testrunner from working
7
+ correctly.
8
+
9
+ Other than that this release is the same as the 0.5.1 release.
10
+
11
+ As of 0.5, Turn has some signifficant new features:
4
12
 
5
13
  While Turn still provides the exact same functionality for running
6
14
  tests via ruby or testrb as previous versions. The turn commandline
data/VERSION CHANGED
@@ -1 +1 @@
1
- turn 0.5.1 stable (2009-03-25)
1
+ turn 0.6.0 stable (2009-05-30)
data/lib/turn.rb CHANGED
@@ -7,6 +7,11 @@ module Console
7
7
  class TestRunner
8
8
  include Turn::Colorize
9
9
 
10
+ # 1.x of test/unut used @io, where as 2.x uses @output.
11
+ def turn_out
12
+ @turn_out ||= (@io || @output)
13
+ end
14
+
10
15
  alias :t_attach_to_mediator :attach_to_mediator
11
16
  def attach_to_mediator
12
17
  @mediator.add_listener(TestRunnerMediator::STARTED, &method(:t_started))
@@ -14,7 +19,7 @@ module Console
14
19
  @mediator.add_listener(TestCase::STARTED, &method(:t_test_started))
15
20
  @mediator.add_listener(TestCase::FINISHED, &method(:t_test_finished))
16
21
  @mediator.add_listener(TestResult::FAULT, &method(:t_fault))
17
- @io.sync = true
22
+ turn_out.sync = true
18
23
  @t_cur_file, @t_fault = nil
19
24
  end
20
25
 
@@ -34,23 +39,23 @@ module Console
34
39
  else ::ANSICode.red bar end
35
40
  end
36
41
 
37
- @io.puts bar
38
- @io.puts " pass: %d, fail: %d, error: %d" % [pass, failure, error]
39
- @io.puts " total: %d tests with %d assertions in #{elapsed_time} seconds" % [total, @t_result.assertion_count]
40
- @io.puts bar
42
+ turn_out.puts bar
43
+ turn_out.puts " pass: %d, fail: %d, error: %d" % [pass, failure, error]
44
+ turn_out.puts " total: %d tests with %d assertions in #{elapsed_time} seconds" % [total, @t_result.assertion_count]
45
+ turn_out.puts bar
41
46
  end
42
47
 
43
48
  def t_test_started( name )
44
49
  method, file = name.scan(%r/^([^\(]+)\(([^\)]+)\)/o).flatten!
45
50
  if @t_cur_file != file
46
51
  @t_cur_file = file
47
- @io.puts file
52
+ turn_out.puts file
48
53
  end
49
- @io.print " %-69s" % method
54
+ turn_out.print " %-69s" % method
50
55
  end
51
56
 
52
57
  def t_test_finished( name )
53
- @io.puts " #{PASS}" unless @t_fault
58
+ turn_out.puts " #{PASS}" unless @t_fault
54
59
  @t_fault = false
55
60
  end
56
61
 
@@ -60,16 +65,16 @@ module Console
60
65
 
61
66
  case fault
62
67
  when ::Test::Unit::Error
63
- @io.puts ERROR
68
+ turn_out.puts ERROR
64
69
  msg << fault.to_s.split("\n")[2..-1].join("\n\t")
65
70
  when ::Test::Unit::Failure
66
- @io.puts " #{FAIL}"
71
+ turn_out.puts " #{FAIL}"
67
72
  msg << fault.location[0].to_s << "\n\t"
68
73
  msg << fault.message.gsub("\n","\n\t")
69
74
  end
70
75
 
71
76
  msg = ::ANSICode.magenta msg if COLORIZE
72
- @io.puts msg
77
+ turn_out.puts msg
73
78
  end
74
79
 
75
80
  end
data/turn.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{turn}
5
- s.version = "0.5.1"
5
+ s.version = "0.6.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Tim Pease"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: TwP-turn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease