jstdutil 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +5 -0
- data/VERSION +1 -1
- data/lib/jstdutil/formatter.rb +21 -17
- data/lib/jstdutil/test_file.rb +3 -3
- data/test/test_file_test.rb +1 -1
- metadata +12 -12
data/Changelog
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 0.3.6 / 2011-05-07
|
2
|
+
* Work around broken utf-8 output from jstestdriver (skip formatting)
|
3
|
+
Thanks to Thomas Pickert
|
4
|
+
* jsautotest now finds files like -test.js as well as _test.js
|
5
|
+
|
1
6
|
== 0.3.5 / 2010-10-31
|
2
7
|
* Bright colors that work on Windows
|
3
8
|
* Autotest no longer initially runs all tests
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
data/lib/jstdutil/formatter.rb
CHANGED
@@ -7,23 +7,27 @@ module Jstdutil
|
|
7
7
|
def self.format(report, type)
|
8
8
|
return "" if report.nil?
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
line
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
10
|
+
begin
|
11
|
+
type.wrap_report(report.split("\n").collect do |line|
|
12
|
+
if line =~ /Passed: 0; Fails: 0; Errors:? 0/
|
13
|
+
type::Color.yellow(line)
|
14
|
+
elsif line =~ /Passed: \d+; Fails: (\d+); Errors:? (\d+)/
|
15
|
+
type::Color.send($1.to_i + $2.to_i != 0 ? :red : :green, line)
|
16
|
+
elsif line =~ /^[\.EF]+$/
|
17
|
+
line.gsub(/\./, type::Color.green(".")).gsub(/F/, type::Color.red("F")).gsub("E", type::Color.yellow("E"))
|
18
|
+
elsif line =~ /failed/
|
19
|
+
type::Color.red(line)
|
20
|
+
elsif line =~ /passed/
|
21
|
+
type::Color.green(line)
|
22
|
+
elsif line =~ /error/
|
23
|
+
type::Color.yellow(line)
|
24
|
+
else
|
25
|
+
line
|
26
|
+
end
|
27
|
+
end.join("\n"))
|
28
|
+
rescue
|
29
|
+
report
|
30
|
+
end
|
27
31
|
end
|
28
32
|
end
|
29
33
|
end
|
data/lib/jstdutil/test_file.rb
CHANGED
@@ -12,11 +12,11 @@ module Jstdutil
|
|
12
12
|
def test_files
|
13
13
|
return @test_files if @test_files
|
14
14
|
|
15
|
-
if @file =~ /(
|
15
|
+
if @file =~ /([-_]test[^\/]+)|([^\/]+[-_]test)\.js/
|
16
16
|
@test_files = [@file]
|
17
17
|
else
|
18
|
-
name = File.basename(@file).gsub(/(
|
19
|
-
@test_files = FileList["**/#{name}_test.js", "**/test_#{name}.js"].uniq
|
18
|
+
name = File.basename(@file).gsub(/([-_]test)|(test[-_])|(\.js)/, "")
|
19
|
+
@test_files = FileList["**/#{name}_test.js", "**/test_#{name}.js", "**/#{name}-test.js", "**/test-#{name}.js"].uniq
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
data/test/test_file_test.rb
CHANGED
@@ -14,7 +14,7 @@ class TestFileTest < Test::Unit::TestCase
|
|
14
14
|
should "find files like _test.js" do
|
15
15
|
file = "some.js"
|
16
16
|
test_file = Jstdutil::TestFile.new(file)
|
17
|
-
FileList.expects(:new).with("**/some_test.js", "**/test_some.js").returns([])
|
17
|
+
FileList.expects(:new).with("**/some_test.js", "**/test_some.js", "**/some-test.js", "**/test-some.js").returns([])
|
18
18
|
|
19
19
|
assert test_file.test_files
|
20
20
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jstdutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 6
|
10
|
+
version: 0.3.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Johansen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-05-07 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -104,8 +104,8 @@ homepage: http://github.com/cjohansen/jstdutil
|
|
104
104
|
licenses: []
|
105
105
|
|
106
106
|
post_install_message:
|
107
|
-
rdoc_options:
|
108
|
-
|
107
|
+
rdoc_options: []
|
108
|
+
|
109
109
|
require_paths:
|
110
110
|
- lib
|
111
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -134,12 +134,12 @@ signing_key:
|
|
134
134
|
specification_version: 3
|
135
135
|
summary: Thin wrapper over Google's JsTestDriver that adds colors and autotest
|
136
136
|
test_files:
|
137
|
-
- test/
|
138
|
-
- test/jstestdriver_config_test.rb
|
139
|
-
- test/test_file_test.rb
|
137
|
+
- test/cli_test.rb
|
140
138
|
- test/colorful_html_test.rb
|
139
|
+
- test/formatter_test.rb
|
141
140
|
- test/jstdutil_test.rb
|
142
|
-
- test/
|
143
|
-
- test/
|
141
|
+
- test/jstestdriver_config_test.rb
|
142
|
+
- test/jstestdriver_test.rb
|
144
143
|
- test/redgreen_test.rb
|
145
|
-
- test/
|
144
|
+
- test/test_file_test.rb
|
145
|
+
- test/test_helper.rb
|