rubytest 0.7.0 → 0.8.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.
- checksums.yaml +7 -0
- data/.index +13 -20
- data/HISTORY.md +12 -0
- data/LICENSE.txt +22 -32
- data/README.md +38 -37
- data/lib/rubytest.rb +4 -6
- data/lib/rubytest.yml +13 -20
- data/lib/rubytest/autorun.rb +1 -1
- data/lib/rubytest/config.rb +21 -1
- data/lib/rubytest/{reporters → format}/abstract.rb +0 -0
- data/lib/rubytest/{reporters → format}/abstract_hash.rb +0 -0
- data/lib/rubytest/{reporters → format}/dotprogress.rb +0 -0
- data/lib/rubytest/{reporters → format}/test.rb +0 -0
- data/lib/rubytest/runner.rb +21 -12
- metadata +21 -82
- data/lib/rubytest/cli.rb +0 -165
- data/lib/rubytest/reporters/html.rb +0 -155
- data/lib/rubytest/reporters/outline.rb +0 -211
- data/lib/rubytest/reporters/progress.rb +0 -195
- data/lib/rubytest/reporters/summary.rb +0 -145
- data/lib/rubytest/reporters/tap.rb +0 -61
- data/lib/rubytest/reporters/tapj.rb +0 -57
- data/lib/rubytest/reporters/tapy.rb +0 -62
metadata
CHANGED
@@ -1,107 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubytest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- trans
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-07-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: ansi
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: fire
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: detroit
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
13
|
- !ruby/object:Gem::Dependency
|
63
14
|
name: qed
|
64
15
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
16
|
requirements:
|
67
|
-
- -
|
17
|
+
- - '>='
|
68
18
|
- !ruby/object:Gem::Version
|
69
19
|
version: '0'
|
70
20
|
type: :development
|
71
21
|
prerelease: false
|
72
22
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
23
|
requirements:
|
75
|
-
- -
|
24
|
+
- - '>='
|
76
25
|
- !ruby/object:Gem::Version
|
77
26
|
version: '0'
|
78
27
|
- !ruby/object:Gem::Dependency
|
79
28
|
name: ae
|
80
29
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
30
|
requirements:
|
83
|
-
- -
|
31
|
+
- - '>='
|
84
32
|
- !ruby/object:Gem::Version
|
85
33
|
version: '0'
|
86
34
|
type: :development
|
87
35
|
prerelease: false
|
88
36
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
37
|
requirements:
|
91
|
-
- -
|
38
|
+
- - '>='
|
92
39
|
- !ruby/object:Gem::Version
|
93
40
|
version: '0'
|
94
|
-
description:
|
95
|
-
|
96
|
-
|
41
|
+
description: Rubytest is a universal test harness for Ruby. It can handle any compliant
|
42
|
+
test framework, even running tests from multiple frameworks in a single pass. This
|
43
|
+
is the core component of the system, and is the only part strictly necessary to
|
44
|
+
run tests.
|
97
45
|
email:
|
98
46
|
- transfire@gmail.com
|
99
47
|
executables: []
|
100
48
|
extensions: []
|
101
49
|
extra_rdoc_files:
|
102
50
|
- LICENSE.txt
|
103
|
-
- HISTORY.md
|
104
51
|
- README.md
|
52
|
+
- HISTORY.md
|
105
53
|
files:
|
106
54
|
- .index
|
107
55
|
- demo/01_test.md
|
@@ -110,7 +58,6 @@ files:
|
|
110
58
|
- demo/applique/rubytest.rb
|
111
59
|
- lib/rubytest/advice.rb
|
112
60
|
- lib/rubytest/autorun.rb
|
113
|
-
- lib/rubytest/cli.rb
|
114
61
|
- lib/rubytest/code_snippet.rb
|
115
62
|
- lib/rubytest/config.rb
|
116
63
|
- lib/rubytest/core_ext/assertion.rb
|
@@ -118,51 +65,43 @@ files:
|
|
118
65
|
- lib/rubytest/core_ext/file.rb
|
119
66
|
- lib/rubytest/core_ext/string.rb
|
120
67
|
- lib/rubytest/core_ext.rb
|
68
|
+
- lib/rubytest/format/abstract.rb
|
69
|
+
- lib/rubytest/format/abstract_hash.rb
|
70
|
+
- lib/rubytest/format/dotprogress.rb
|
71
|
+
- lib/rubytest/format/test.rb
|
121
72
|
- lib/rubytest/recorder.rb
|
122
|
-
- lib/rubytest/reporters/abstract.rb
|
123
|
-
- lib/rubytest/reporters/abstract_hash.rb
|
124
|
-
- lib/rubytest/reporters/dotprogress.rb
|
125
|
-
- lib/rubytest/reporters/html.rb
|
126
|
-
- lib/rubytest/reporters/outline.rb
|
127
|
-
- lib/rubytest/reporters/progress.rb
|
128
|
-
- lib/rubytest/reporters/summary.rb
|
129
|
-
- lib/rubytest/reporters/tap.rb
|
130
|
-
- lib/rubytest/reporters/tapj.rb
|
131
|
-
- lib/rubytest/reporters/tapy.rb
|
132
|
-
- lib/rubytest/reporters/test.rb
|
133
73
|
- lib/rubytest/runner.rb
|
134
74
|
- lib/rubytest.rb
|
135
75
|
- lib/rubytest.yml
|
136
76
|
- lib/test.rb
|
137
77
|
- test/basic_case.rb
|
138
78
|
- test/helper.rb
|
139
|
-
- HISTORY.md
|
140
79
|
- README.md
|
80
|
+
- HISTORY.md
|
141
81
|
- LICENSE.txt
|
142
82
|
homepage: http://rubyworks.github.com/rubytest
|
143
83
|
licenses:
|
144
84
|
- BSD-2-Clause
|
85
|
+
metadata: {}
|
145
86
|
post_install_message:
|
146
87
|
rdoc_options: []
|
147
88
|
require_paths:
|
148
89
|
- lib
|
149
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
-
none: false
|
151
91
|
requirements:
|
152
|
-
- -
|
92
|
+
- - '>='
|
153
93
|
- !ruby/object:Gem::Version
|
154
94
|
version: '0'
|
155
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
-
none: false
|
157
96
|
requirements:
|
158
|
-
- -
|
97
|
+
- - '>='
|
159
98
|
- !ruby/object:Gem::Version
|
160
99
|
version: '0'
|
161
100
|
requirements: []
|
162
101
|
rubyforge_project:
|
163
|
-
rubygems_version:
|
102
|
+
rubygems_version: 2.0.3
|
164
103
|
signing_key:
|
165
|
-
specification_version:
|
104
|
+
specification_version: 4
|
166
105
|
summary: Ruby Universal Test Harness
|
167
106
|
test_files:
|
168
107
|
- test/helper.rb
|
data/lib/rubytest/cli.rb
DELETED
@@ -1,165 +0,0 @@
|
|
1
|
-
module Test
|
2
|
-
|
3
|
-
# Command line interface to test runner.
|
4
|
-
#
|
5
|
-
# TODO: Use `cli` based library instead of option parser?
|
6
|
-
#
|
7
|
-
class CLI
|
8
|
-
|
9
|
-
# Convenience method for invoking the CLI.
|
10
|
-
#
|
11
|
-
# @return nothing
|
12
|
-
def self.run(*argv)
|
13
|
-
new.run(*argv)
|
14
|
-
end
|
15
|
-
|
16
|
-
# Initialize CLI instance.
|
17
|
-
#
|
18
|
-
# @return nothing
|
19
|
-
def initialize
|
20
|
-
require 'optparse'
|
21
|
-
|
22
|
-
@config = Test.configuration(true)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Test run configuration.
|
26
|
-
#
|
27
|
-
# @return [Config]
|
28
|
-
def config
|
29
|
-
@config
|
30
|
-
end
|
31
|
-
|
32
|
-
# Run tests.
|
33
|
-
#
|
34
|
-
# @return nothing
|
35
|
-
def run(argv=nil)
|
36
|
-
argv = (argv || ARGV.dup)
|
37
|
-
|
38
|
-
options.parse!(argv)
|
39
|
-
|
40
|
-
config.files.replace(argv) unless argv.empty?
|
41
|
-
|
42
|
-
config.apply_environment_overrides
|
43
|
-
|
44
|
-
#Test.run(config)
|
45
|
-
runner = Runner.new(config)
|
46
|
-
begin
|
47
|
-
success = runner.run
|
48
|
-
exit -1 unless success
|
49
|
-
rescue => error
|
50
|
-
raise error if $DEBUG
|
51
|
-
$stderr.puts('ERROR: ' + error.to_s)
|
52
|
-
exit -1
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
# Setup OptionsParser instance.
|
57
|
-
#
|
58
|
-
# @return [OptionParser]
|
59
|
-
def options
|
60
|
-
this = self
|
61
|
-
|
62
|
-
OptionParser.new do |opt|
|
63
|
-
opt.banner = "Usage: #{File.basename($0)} [options] [files ...]"
|
64
|
-
|
65
|
-
#opt.separator "PRESET OPTIONS:"
|
66
|
-
#pnames = profile_names
|
67
|
-
#unless pnames.empty?
|
68
|
-
# pnames.each do |pname|
|
69
|
-
# opt.separator((" " * 40) + "* #{pname}")
|
70
|
-
# end
|
71
|
-
#end
|
72
|
-
#opt.separator "CONFIG OPTIONS:"
|
73
|
-
|
74
|
-
opt.on '-f', '--format NAME', 'report format' do |name|
|
75
|
-
config.format = name
|
76
|
-
end
|
77
|
-
opt.on '-y', '--tapy', 'shortcut for -f tapy' do
|
78
|
-
config.format = 'tapy'
|
79
|
-
end
|
80
|
-
opt.on '-j', '--tapj', 'shortcut for -f tapj' do
|
81
|
-
config.format = 'tapj'
|
82
|
-
end
|
83
|
-
|
84
|
-
# tempted to change -T
|
85
|
-
opt.on '-t', '--tag TAG', 'select tests by tag' do |tag|
|
86
|
-
config.tags.concat makelist(tag)
|
87
|
-
end
|
88
|
-
opt.on '-u', '--unit TAG', 'select tests by software unit' do |unit|
|
89
|
-
config.units.concat makelist(unit)
|
90
|
-
end
|
91
|
-
opt.on '-m', '--match TEXT', 'select tests by description' do |text|
|
92
|
-
config.match.concat makelist(text)
|
93
|
-
end
|
94
|
-
|
95
|
-
opt.on '-A', '--autopath', 'automatically add paths to $LOAD_PATH' do |paths|
|
96
|
-
config.autopath = true
|
97
|
-
end
|
98
|
-
opt.on '-I', '--loadpath PATH', 'add given path to $LOAD_PATH' do |paths|
|
99
|
-
#makelist(paths).reverse_each do |path|
|
100
|
-
# $LOAD_PATH.unshift path
|
101
|
-
#end
|
102
|
-
config.loadpath.concat makelist(paths)
|
103
|
-
end
|
104
|
-
opt.on '-C', '--chdir DIR', 'change directory before running tests' do |dir|
|
105
|
-
config.chdir = dir
|
106
|
-
end
|
107
|
-
opt.on '-R', '--chroot', 'change to project root directory before running tests' do
|
108
|
-
config.chdir = Config.root
|
109
|
-
end
|
110
|
-
opt.on '-r', '--require FILE', 'require file' do |file|
|
111
|
-
#require file
|
112
|
-
config.requires.concat makelist(file)
|
113
|
-
end
|
114
|
-
opt.on '-c', '--config FILE', "require local config file (immediately)" do |file|
|
115
|
-
config.load_config(file)
|
116
|
-
end
|
117
|
-
#opt.on '-T', '--tests GLOB', "tests to run (if none given as arguments)" do |glob|
|
118
|
-
# config.files << glob
|
119
|
-
#end
|
120
|
-
opt.on '-V' , '--verbose', 'provide extra detail in reports' do
|
121
|
-
config.verbose = true
|
122
|
-
end
|
123
|
-
#opt.on('--log PATH', 'log test output to path'){ |path|
|
124
|
-
# config.log = path
|
125
|
-
#}
|
126
|
-
opt.on("--[no-]ansi" , 'turn on/off ANSI colors'){ |v| $ansi = v }
|
127
|
-
opt.on("--debug" , 'turn on debugging mode'){ $DEBUG = true }
|
128
|
-
|
129
|
-
#opt.separator "COMMAND OPTIONS:"
|
130
|
-
opt.on('--about' , 'display information about rubytest') do
|
131
|
-
puts "Ruby Test v%s" % [Test.index['version']]
|
132
|
-
Test.index['copyrights'].each do |c|
|
133
|
-
puts "(c) %s %s (%s)" % c.values_at('year', 'holder', 'license')
|
134
|
-
end
|
135
|
-
exit
|
136
|
-
end
|
137
|
-
opt.on('--version' , 'display rubytest version') do
|
138
|
-
puts Test::VERSION
|
139
|
-
exit
|
140
|
-
end
|
141
|
-
opt.on('-h', '--help', 'display this help message'){
|
142
|
-
puts opt
|
143
|
-
exit
|
144
|
-
}
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
# If given a String then split up at `:` and `;` markers.
|
149
|
-
# Otherwise ensure the list is an Array and the entries are
|
150
|
-
# all strings and not empty.
|
151
|
-
#
|
152
|
-
# @return [Array<String>]
|
153
|
-
def makelist(list)
|
154
|
-
case list
|
155
|
-
when String
|
156
|
-
list = list.split(/[:;]/)
|
157
|
-
else
|
158
|
-
list = Array(list).map{ |path| path.to_s }
|
159
|
-
end
|
160
|
-
list.reject{ |path| path.strip.empty? }
|
161
|
-
end
|
162
|
-
|
163
|
-
end
|
164
|
-
|
165
|
-
end
|
@@ -1,155 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
module Test::Reporters
|
4
|
-
|
5
|
-
# HTML Test Reporter
|
6
|
-
#
|
7
|
-
# This reporter is rather simplistic and rough at this point --in need
|
8
|
-
# of some TLC. Also, it may move to the TAPOUT project rather than be
|
9
|
-
# a built-in Ruby-Test reporter.
|
10
|
-
#--
|
11
|
-
# TODO: Make this more like a microformat and add timer info.
|
12
|
-
#++
|
13
|
-
class Html < Abstract
|
14
|
-
|
15
|
-
#
|
16
|
-
def begin_suite(suite)
|
17
|
-
timer_reset
|
18
|
-
|
19
|
-
@html = []
|
20
|
-
@html << %[<html>]
|
21
|
-
@html << %[<head>]
|
22
|
-
@html << %[<title>Test Report</title>]
|
23
|
-
@html << %[ <style>]
|
24
|
-
@html << %[ html{ background: #fff; margin: 0; padding: 0; font-family: helvetica; }]
|
25
|
-
@html << %[ body{ margin: 0; padding: 0;}]
|
26
|
-
@html << %[ h3{color:#555;}]
|
27
|
-
@html << %[ #main{ margin: 0 auto; color: #110; width: 600px; ]
|
28
|
-
@html << %[ border-right: 1px solid #ddd; border-left: 1px solid #ddd; ]
|
29
|
-
@html << %[ padding: 10px 30px; width: 500px; } ]
|
30
|
-
@html << %[ .lemon{ color: gold; font-size: 22px; font-weight: bold; ]
|
31
|
-
@html << %[ font-family: courier; margin-bottom: -15px;}]
|
32
|
-
@html << %[ .tally{ font-weight: bold; margin-bottom: 10px; }]
|
33
|
-
@html << %[ .omit{ color: cyan; }]
|
34
|
-
@html << %[ .pass{ color: green; }]
|
35
|
-
@html << %[ .fail{ color: red; }]
|
36
|
-
@html << %[ .footer{ font-size: 0.7em; color: #666; margin: 20px 0; }]
|
37
|
-
@html << %[ </style>]
|
38
|
-
@html << %[</head>]
|
39
|
-
@html << %[<body>]
|
40
|
-
@html << %[<div id="main">]
|
41
|
-
@html << %[<div class="lemon">R U B Y - T E S T</div>]
|
42
|
-
@html << %[<h1>Test Report</h1>]
|
43
|
-
@body = []
|
44
|
-
end
|
45
|
-
|
46
|
-
#
|
47
|
-
def begin_case(tc)
|
48
|
-
lines = tc.to_s.split("\n")
|
49
|
-
title = lines.shift
|
50
|
-
@body << "<h2>"
|
51
|
-
@body << title
|
52
|
-
@body << "</h2>"
|
53
|
-
@body << "<div>"
|
54
|
-
@body << lines.join("<br/>")
|
55
|
-
@body << "</div>"
|
56
|
-
end
|
57
|
-
|
58
|
-
#
|
59
|
-
def begin_test(test)
|
60
|
-
if test.respond_to?(:topic)
|
61
|
-
topic = test.topic
|
62
|
-
if @topic != topic
|
63
|
-
@topic = topic
|
64
|
-
@body << "<h3>"
|
65
|
-
@body << "#{topic}"
|
66
|
-
@body << "</h3>"
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
#
|
72
|
-
def pass(test)
|
73
|
-
@body << %[<li class="pass">]
|
74
|
-
@body << "%s %s" % ["PASS", test.to_s]
|
75
|
-
@body << %[</li>]
|
76
|
-
end
|
77
|
-
|
78
|
-
#
|
79
|
-
def fail(test, exception)
|
80
|
-
@body << %[<li class="fail">]
|
81
|
-
@body << "%s %s" % ["FAIL", test.to_s]
|
82
|
-
@body << "<pre>"
|
83
|
-
@body << " FAIL #{clean_backtrace(exception)[0]}"
|
84
|
-
@body << " #{exception}"
|
85
|
-
@body << "</pre>"
|
86
|
-
@body << %[</li>]
|
87
|
-
end
|
88
|
-
|
89
|
-
#
|
90
|
-
def error(test, exception)
|
91
|
-
@body << %[<li class="error">]
|
92
|
-
@body << "%s %s" % ["ERROR", test.to_s]
|
93
|
-
@body << "<pre>"
|
94
|
-
@body << " ERROR #{exception.class}"
|
95
|
-
@body << " #{exception}"
|
96
|
-
@body << " " + clean_backtrace(exception).join("\n ")
|
97
|
-
@body << "</pre>"
|
98
|
-
@body << %[</li>]
|
99
|
-
end
|
100
|
-
|
101
|
-
#
|
102
|
-
def todo(test, exception)
|
103
|
-
@body << %[<li class="pending">]
|
104
|
-
@body << "%s %s" % ["PENDING", test.to_s]
|
105
|
-
@body << %[</li>]
|
106
|
-
end
|
107
|
-
|
108
|
-
#
|
109
|
-
def omit(test, exception)
|
110
|
-
@body << %[<li class="omit">]
|
111
|
-
@body << "%s %s" % ["OMIT", test.to_s]
|
112
|
-
@body << %[</li>]
|
113
|
-
end
|
114
|
-
|
115
|
-
#
|
116
|
-
def end_suite(suite)
|
117
|
-
@html << ""
|
118
|
-
@html << %[<div class="tally">]
|
119
|
-
@html << tally
|
120
|
-
@html << %[</div>]
|
121
|
-
@html << ""
|
122
|
-
|
123
|
-
@body << ""
|
124
|
-
@body << %[<div class="footer">]
|
125
|
-
@body << %[Generated by <a href="http://rubyworks.github.com/test">Lemon</a>]
|
126
|
-
@body << %[on #{Time.now}.]
|
127
|
-
@body << %[</div>]
|
128
|
-
@body << ""
|
129
|
-
@body << %[</div>]
|
130
|
-
@body << %[</div>]
|
131
|
-
@body << ""
|
132
|
-
@body << %[</body>]
|
133
|
-
@body << %[</html>]
|
134
|
-
|
135
|
-
puts @html.join("\n")
|
136
|
-
puts @body.join("\n")
|
137
|
-
end
|
138
|
-
|
139
|
-
private
|
140
|
-
|
141
|
-
#
|
142
|
-
def timer
|
143
|
-
secs = Time.now - @time
|
144
|
-
@time = Time.now
|
145
|
-
return "%0.5fs" % [secs.to_s]
|
146
|
-
end
|
147
|
-
|
148
|
-
#
|
149
|
-
def timer_reset
|
150
|
-
@time = Time.now
|
151
|
-
end
|
152
|
-
|
153
|
-
end
|
154
|
-
|
155
|
-
end
|