dohtest 0.1.8 → 0.1.9
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/bin/dohtest +6 -4
- data/lib/doh/test/stream_output.rb +4 -3
- metadata +7 -8
data/bin/dohtest
CHANGED
@@ -4,10 +4,11 @@ require 'doh/test/configure'
|
|
4
4
|
require 'doh/test/master_runner'
|
5
5
|
require 'doh/test/stream_output'
|
6
6
|
|
7
|
-
opts = Doh::Options.new(
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
opts = Doh::Options.new({
|
8
|
+
'grep' => [nil, "-g", "--grep <name>", "only execute tests with name that include the given value."],
|
9
|
+
'glob' => [nil, "-b", "--glob <string>", "glob string to find test files. defaults to *.dt.rb"],
|
10
|
+
'seed' => [nil, "-v", "--seed <number>", "use this as the seed to srand"],
|
11
|
+
'no_color' => [nil, '-c', '--no_color', "use this if you don't want ANSI color codes"],
|
11
12
|
}, true, 'Files or directories may be specified to run tests on. Directories will be treated recursively. Defaults to the current directory.')
|
12
13
|
|
13
14
|
paths = (if opts.varargs.empty? then ['.'] else opts.varargs end)
|
@@ -16,5 +17,6 @@ DohTest::configure(paths[0])
|
|
16
17
|
DohTest::config[:grep] = opts.grep if opts.grep
|
17
18
|
DohTest::config[:glob] = opts.glob if opts.glob
|
18
19
|
DohTest::config[:seed] = opts.seed.to_i if opts.seed
|
20
|
+
DohTest::config[:no_color] = true if opts.no_color
|
19
21
|
|
20
22
|
exit DohTest::MasterRunner.new(DohTest::StreamOutput.new, DohTest::config, paths).run
|
@@ -112,6 +112,7 @@ class StreamOutput
|
|
112
112
|
|
113
113
|
private
|
114
114
|
def colorize(type, msg)
|
115
|
+
return msg if @config[:no_color]
|
115
116
|
color = @config["#{type}_color".to_sym] || DEFAULT_COLORS[type]
|
116
117
|
"#{Term::ANSIColor.send(color)}#{Term::ANSIColor.bold}#{msg}#{Term::ANSIColor.clear}"
|
117
118
|
end
|
@@ -143,7 +144,7 @@ private
|
|
143
144
|
end
|
144
145
|
|
145
146
|
def display_equal_failure(failure)
|
146
|
-
warn colorize(:info, "expected: #{failure.expected}\n actual: #{failure.actual}")
|
147
|
+
warn colorize(:info, "expected: #{failure.expected.inspect}\n actual: #{failure.actual.inspect}")
|
147
148
|
end
|
148
149
|
|
149
150
|
def display_raises_failure(failure)
|
@@ -159,7 +160,7 @@ private
|
|
159
160
|
end
|
160
161
|
|
161
162
|
def display_instance_of_failure(failure)
|
162
|
-
warn colorize(:info, "expected class: #{failure.expected}; actual: #{failure.actual}")
|
163
|
+
warn colorize(:info, "expected class: #{failure.expected}; actual class: #{failure.actual.class}, object: #{failure.actual}")
|
163
164
|
end
|
164
165
|
|
165
166
|
def display_match_failure(failure)
|
@@ -167,7 +168,7 @@ private
|
|
167
168
|
end
|
168
169
|
|
169
170
|
def display_not_equal_failure(failure)
|
170
|
-
warn colorize(:info, "expected unequal values; both are: #{failure.expected}")
|
171
|
+
warn colorize(:info, "expected unequal values; both are: #{failure.expected.inspect}")
|
171
172
|
end
|
172
173
|
|
173
174
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohtest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-01-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dohroot
|
17
|
-
requirement: &
|
17
|
+
requirement: &70098924622080 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 0.1.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70098924622080
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: term-ansicolor
|
28
|
-
requirement: &
|
28
|
+
requirement: &70098924621560 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: 1.0.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70098924621560
|
37
37
|
description: Minimalist unit test framework, easy to understand and extend.
|
38
38
|
email:
|
39
39
|
- devinfo@atpsoft.com
|
@@ -78,11 +78,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.8.
|
81
|
+
rubygems_version: 1.8.12
|
82
82
|
signing_key:
|
83
83
|
specification_version: 3
|
84
84
|
summary: minimalist unit test framework
|
85
85
|
test_files:
|
86
86
|
- test/test_backtrace_parser.rb
|
87
87
|
- test/test_group_runner.rb
|
88
|
-
has_rdoc:
|