TwP-turn 0.5.1 → 0.6.0
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/History.txt +3 -0
- data/README.txt +4 -1
- data/Release.txt +10 -2
- data/VERSION +1 -1
- data/lib/turn.rb +16 -11
- data/turn.gemspec +1 -1
- metadata +1 -1
data/History.txt
CHANGED
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.
|
1
|
+
= Turn 0.6
|
2
2
|
|
3
|
-
Turn
|
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.
|
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
|
-
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
52
|
+
turn_out.puts file
|
48
53
|
end
|
49
|
-
|
54
|
+
turn_out.print " %-69s" % method
|
50
55
|
end
|
51
56
|
|
52
57
|
def t_test_finished( name )
|
53
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
77
|
+
turn_out.puts msg
|
73
78
|
end
|
74
79
|
|
75
80
|
end
|
data/turn.gemspec
CHANGED