test 0.2.0 → 0.2.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.
data/.ruby CHANGED
@@ -1,43 +1,46 @@
1
- ---
2
- authors:
1
+ ---
2
+ authors:
3
3
  - name: Thomas Sawyer
4
4
  email: transfire@gmail.com
5
- copyrights:
5
+ copyrights:
6
6
  - holder: Thomas Sawyer, RubyWorks
7
- year: '2011'
7
+ year: "2011"
8
8
  license: FreeBSD
9
9
  replacements: []
10
+
10
11
  conflicts: []
11
- requirements:
12
+
13
+ requirements:
12
14
  - name: ansi
13
15
  - name: detroit
14
- groups:
16
+ groups:
15
17
  - build
16
18
  development: true
17
19
  - name: qed
18
- groups:
20
+ groups:
19
21
  - test
20
22
  development: true
21
23
  dependencies: []
22
- repositories:
24
+
25
+ repositories:
23
26
  - uri: git@github.com:rubyworks/test.git
24
27
  scm: git
25
28
  name: upstream
26
- resources:
29
+ resources:
27
30
  home: http://rubyworks.github.com/test
28
31
  code: http://github.com/rubyworks/test
29
32
  mail: http://groups.google.com/group/rubyworks-mailinglist
30
- load_path:
33
+ load_path:
31
34
  - lib
32
- extra:
35
+ extra:
33
36
  manifest: MANIFEST
34
37
  alternatives: []
38
+
35
39
  revision: 0
36
40
  name: test
37
41
  title: Ruby Test
38
42
  summary: Ruby Universal Test Harness
39
- created: '2011-07-23'
40
- description: Ruby Test is a universal test harness for Ruby. It can handle any compliant test
41
- framework, even running tests from multiple frameworks in a single pass.
42
- version: 0.2.0
43
- date: '2011-08-10'
43
+ created: "2011-07-23"
44
+ description: Ruby Test is a universal test harness for Ruby. It can handle any compliant test framework, even running tests from multiple frameworks in a single pass.
45
+ version: 0.2.1
46
+ date: "2011-08-12"
data/.yardopts CHANGED
@@ -1,4 +1,4 @@
1
- --output-dir site/api
1
+ --output-dir doc
2
2
  --protected
3
3
  --readme README.md
4
4
  lib
data/MANIFEST CHANGED
@@ -32,7 +32,6 @@ test/basic_case.rb
32
32
  PROFILE
33
33
  LICENSE.txt
34
34
  HISTORY.md
35
- HISTORY.md.bak
36
35
  README.md
37
36
  VERSION
38
37
  COPYING.rdoc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -41,6 +41,10 @@ module Test
41
41
  # Filter tests by matching description.
42
42
  attr_accessor :match
43
43
 
44
+ # From Rake's own TestTask.
45
+ alias_method :libs, :loadpath
46
+ alias_method :test_files, :tests
47
+
44
48
  #
45
49
  def initialize(name='test', desc="run tests", &block)
46
50
  @name = name
@@ -134,23 +134,53 @@ module Test
134
134
 
135
135
  #
136
136
  def subtotal
137
- [:todo, :pass, :fail, :error, :omit].inject(0) do |s,r|
137
+ [:todo, :pass, :fail, :error, :omit, :skip].inject(0) do |s,r|
138
138
  s += record[r.to_sym].size; s
139
139
  end
140
140
  end
141
141
 
142
+ # TODO: lump skipped and omitted into one group ?
143
+
144
+ TITLES = {
145
+ :pass => 'passing',
146
+ :fail => 'failures',
147
+ :error => 'errors',
148
+ :todo => 'pending',
149
+ :omit => 'omissions',
150
+ :skip => 'skipped'
151
+ }
152
+
142
153
  # TODO: Add assertion counts (if reasonably possible).
143
154
 
144
155
  # Common tally stamp any reporter can use.
145
156
  #
146
157
  # @return [String] tally stamp
147
158
  def tally
148
- sizes = %w{pass fail error todo omit}.map{ |r| record[r.to_sym].size }
149
- data = [total] + sizes
159
+ sizes = {}
160
+ names = %w{error fail todo omit skip}.map{ |n| n.to_sym }
161
+ names.each do |r|
162
+ sizes[r] = record[r].size
163
+ end
150
164
 
151
- s = "%s tests: %s passing, %s failures, %s errors, %s pending, %s omissions" % data
152
- #s += "(#{uncovered_units.size} uncovered, #{undefined_units.size} undefined)" if cover?
153
- s
165
+ #names.unshift(:tests)
166
+ #sizes[:tests] = total
167
+
168
+ s = []
169
+ names.each do |n|
170
+ next unless sizes[n] > 0
171
+ s << tally_item(n, sizes)
172
+ end
173
+
174
+ 'Executed ' + "#{total}".ansi(:bold) + ' tests with ' + s.join(', ')
175
+ end
176
+
177
+ #
178
+ def tally_item(name, sizes)
179
+ x = []
180
+ x << "%s" % sizes[name].to_s.ansi(:bold)
181
+ x << " %s" % TITLES[name].downcase
182
+ x << " (%.1f%%)" % ((sizes[name].to_f/total*100)) if runner.verbose?
183
+ x.join('')
154
184
  end
155
185
 
156
186
  #--
@@ -37,7 +37,7 @@ module Test::Reporters
37
37
 
38
38
  if runner.verbose?
39
39
  unless record[:omit].empty?
40
- puts "OMISSIONS:\n\n"
40
+ puts "OMISSIONS\n\n"
41
41
  record[:omit].each do |test, exception|
42
42
  puts " #{test}".ansi(:bold)
43
43
  puts " #{exception}"
@@ -49,7 +49,7 @@ module Test::Reporters
49
49
  end
50
50
 
51
51
  unless record[:todo].empty?
52
- puts "PENDING:\n\n"
52
+ puts "PENDING\n\n"
53
53
  record[:todo].each do |test, exception|
54
54
  puts " #{test}".ansi(:bold) unless test.to_s.empty?
55
55
  puts " #{exception}"
@@ -60,7 +60,7 @@ module Test::Reporters
60
60
  end
61
61
 
62
62
  unless record[:fail].empty?
63
- puts "FAILURES:\n\n"
63
+ puts "FAILURES\n\n"
64
64
  record[:fail].each do |test_unit, exception|
65
65
  puts " #{test_unit}".ansi(:bold)
66
66
  puts " #{exception}"
@@ -71,7 +71,7 @@ module Test::Reporters
71
71
  end
72
72
 
73
73
  unless record[:error].empty?
74
- puts "ERRORS:\n\n"
74
+ puts "ERRORS\n\n"
75
75
  record[:error].each do |test_unit, exception|
76
76
  puts " #{test_unit}".ansi(:bold)
77
77
  puts " #{exception}"
@@ -1,31 +1,77 @@
1
1
  <html>
2
2
  <head>
3
+ <title>Ruby Test</title>
3
4
  <style>
5
+ html { font-family: sans-serif; }
4
6
  body { margin: 0; padding: 0; }
5
- a { text-decoration: none; color: #888888; padding: 5px 10px; }
6
- a:hover { color: white; }
7
+ a { text-decoration: none; color: #ddd; padding: 5px 10px; }
8
+ a:hover { color: #fff; }
7
9
 
8
10
  #main { background: url(assets/images/test_pattern.jpg) top no-repeat; height: 780px;
9
11
  position: relative; margin: 10px 0; padding: 0; }
10
12
 
11
13
  #line { width: 100%; color: #cc2222; font-size: 72px; text-align: center;
12
- background: red; font-weight: bold; opacity: 0.9; }
14
+ background: red; font-weight: bold; opacity: 0.9; font-family: times; }
15
+
16
+ #footer {
17
+ width: 1024px; margin: 10px auto; text-align: center;
13
18
  }
19
+
20
+ #footer a { color: red; font-size: 1.5em; }
21
+ #footer a:hover { color: black; }
22
+
23
+ .copyright { color: #555; }
14
24
  </style>
15
25
  </head>
16
-
17
26
  <body>
18
- <div id="main">
19
- <div style="height: 340px;"></div>
20
27
 
21
- <div id="line">
22
- <a href="http://github.com/rubyworks/test/wiki">
23
- R U B Y &nbsp;&nbsp; T E S T
24
- </a>
25
- </div>
28
+ <div id="main">
29
+ <div style="height: 340px;"></div>
26
30
 
31
+ <div id="line">
32
+ <a href="http://github.com/rubyworks/test/wiki">
33
+ RUBY UNIVERSAL TEST HARNESS
34
+ </a>
27
35
  </div>
36
+ </div>
28
37
 
29
- </body>
38
+ <div id="footer">
39
+ <div class="nav">
40
+ <a href="http://wiki.github.com/rubyworks/test">User Guide</a>
41
+ <a href="http://rubyinfo.org/gems/test">API Reference</a>
42
+ <a href="http://github.com/rubyworks/test">Development</a>
43
+ <div>
30
44
 
45
+ <div style="margin: 40px 0;">
46
+ <script type="text/javascript"><!--
47
+ google_ad_client = "ca-pub-1126154564663472";
48
+ /* RUBYWORKS 09-10-02 728x90 */
49
+ google_ad_slot = "0788888658";
50
+ google_ad_width = 728;
51
+ google_ad_height = 90;
52
+ //-->
53
+ </script>
54
+ <script type="text/javascript"
55
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
56
+ </script>
57
+ </div>
58
+
59
+ <div class="copyright">
60
+ Copyright (c) 2011 TRANS, RubyWorks &middot; FreeBSD License
61
+ <div>
62
+ </div>
63
+
64
+ <div style="position: absolute; top: 0; right: 0;">
65
+ <a href="http://github.com/rubyworks/ae">
66
+ <img src="http://rubyworks.github.com/assets/images/fork-me.png" />
67
+ </a>
68
+ </div>
69
+
70
+ <div id="rubyworks" style="position: fixed; bottom: 5px; right: 10px; padding: 0; opacity: 0.3;">
71
+ <a href="http://rubyworks.github.com">
72
+ <img src="http://rubyworks.github.com/assets/images/seal.png" height="150px" />
73
+ </a>
74
+ </div>
75
+
76
+ </body>
31
77
  </html>
metadata CHANGED
@@ -1,62 +1,63 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: test
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.2.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Thomas Sawyer
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-11 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2011-08-12 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
15
16
  name: ansi
16
- requirement: &23355460 !ruby/object:Gem::Requirement
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
17
19
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
22
24
  type: :runtime
23
- prerelease: false
24
- version_requirements: *23355460
25
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
26
27
  name: detroit
27
- requirement: &23354640 !ruby/object:Gem::Requirement
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
28
30
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
33
35
  type: :development
34
- prerelease: false
35
- version_requirements: *23354640
36
- - !ruby/object:Gem::Dependency
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
37
38
  name: qed
38
- requirement: &23353900 !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
39
41
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
44
46
  type: :development
45
- prerelease: false
46
- version_requirements: *23353900
47
- description: Ruby Test is a universal test harness for Ruby. It can handle any compliant test
48
- framework, even running tests from multiple frameworks in a single pass.
49
- email:
47
+ version_requirements: *id003
48
+ description: Ruby Test is a universal test harness for Ruby. It can handle any compliant test framework, even running tests from multiple frameworks in a single pass.
49
+ email:
50
50
  - transfire@gmail.com
51
- executables:
51
+ executables:
52
52
  - ruby-test
53
53
  extensions: []
54
- extra_rdoc_files:
54
+
55
+ extra_rdoc_files:
55
56
  - LICENSE.txt
56
57
  - COPYING.rdoc
57
58
  - HISTORY.md
58
59
  - README.md
59
- files:
60
+ files:
60
61
  - .gemspec
61
62
  - .gitignore
62
63
  - .ruby
@@ -104,26 +105,30 @@ files:
104
105
  - work/NOTES.md
105
106
  homepage: http://rubyworks.github.com/test
106
107
  licenses: []
108
+
107
109
  post_install_message:
108
110
  rdoc_options: []
109
- require_paths:
111
+
112
+ require_paths:
110
113
  - lib
111
- required_ruby_version: !ruby/object:Gem::Requirement
114
+ required_ruby_version: !ruby/object:Gem::Requirement
112
115
  none: false
113
- requirements:
114
- - - ! '>='
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
- required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: "0"
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
121
  none: false
119
- requirements:
120
- - - ! '>='
121
- - !ruby/object:Gem::Version
122
- version: '0'
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: "0"
123
126
  requirements: []
127
+
124
128
  rubyforge_project:
125
- rubygems_version: 1.8.5
129
+ rubygems_version: 1.8.2
126
130
  signing_key:
127
131
  specification_version: 3
128
132
  summary: Ruby Universal Test Harness
129
133
  test_files: []
134
+