jstdutil 0.3.10 → 0.3.11
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/Changelog +3 -0
- data/GPATH +0 -0
- data/GRTAGS +0 -0
- data/GSYMS +0 -0
- data/GTAGS +0 -0
- data/VERSION +1 -1
- data/lib/jstdutil/test_file.rb +11 -1
- data/test/test_file_test.rb +12 -1
- metadata +10 -14
data/Changelog
CHANGED
data/GPATH
ADDED
Binary file
|
data/GRTAGS
ADDED
Binary file
|
data/GSYMS
ADDED
Binary file
|
data/GTAGS
ADDED
Binary file
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.11
|
data/lib/jstdutil/test_file.rb
CHANGED
@@ -16,7 +16,11 @@ module Jstdutil
|
|
16
16
|
@test_files = [@file]
|
17
17
|
else
|
18
18
|
name = File.basename(@file).gsub(/([-_]test)|(test[-_])|(\.js)/, "")
|
19
|
-
@test_files = FileList["**/#{name}_test.js",
|
19
|
+
@test_files = FileList["**/#{name}_test.js",
|
20
|
+
"**/test_#{name}.js",
|
21
|
+
"**/#{name}-test.js",
|
22
|
+
"**/test-#{name}.js",
|
23
|
+
"**/#{camelize(name)}Test.js"].uniq
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
@@ -29,5 +33,11 @@ module Jstdutil
|
|
29
33
|
|
30
34
|
@cases.flatten!
|
31
35
|
end
|
36
|
+
|
37
|
+
private
|
38
|
+
def camelize(str)
|
39
|
+
pieces = str.split(/[^a-z0-9]/i)
|
40
|
+
pieces.shift + pieces.map { |w| w.capitalize }.join
|
41
|
+
end
|
32
42
|
end
|
33
43
|
end
|
data/test/test_file_test.rb
CHANGED
@@ -14,10 +14,21 @@ 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",
|
17
|
+
FileList.expects(:new).with("**/some_test.js", "**/test_some.js",
|
18
|
+
"**/some-test.js", "**/test-some.js",
|
19
|
+
"**/someTest.js").returns([])
|
18
20
|
|
19
21
|
assert test_file.test_files
|
20
22
|
end
|
23
|
+
|
24
|
+
should "find camelized file names" do
|
25
|
+
file = "some_thing.js"
|
26
|
+
test_file = Jstdutil::TestFile.new(file)
|
27
|
+
FileList.expects(:new).with("**/some_thing_test.js", "**/test_some_thing.js",
|
28
|
+
"**/some_thing-test.js", "**/test-some_thing.js",
|
29
|
+
"**/someThingTest.js").returns([])
|
30
|
+
assert test_file.test_files
|
31
|
+
end
|
21
32
|
end
|
22
33
|
|
23
34
|
context "test cases" do
|
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: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 11
|
10
|
+
version: 0.3.11
|
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: 2012-01-26 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -72,6 +72,10 @@ extra_rdoc_files:
|
|
72
72
|
- README.rdoc
|
73
73
|
files:
|
74
74
|
- Changelog
|
75
|
+
- GPATH
|
76
|
+
- GRTAGS
|
77
|
+
- GSYMS
|
78
|
+
- GTAGS
|
75
79
|
- LICENSE
|
76
80
|
- README.rdoc
|
77
81
|
- Rakefile
|
@@ -133,13 +137,5 @@ rubygems_version: 1.3.7
|
|
133
137
|
signing_key:
|
134
138
|
specification_version: 3
|
135
139
|
summary: Thin wrapper over Google's JsTestDriver that adds colors and autotest
|
136
|
-
test_files:
|
137
|
-
|
138
|
-
- test/colorful_html_test.rb
|
139
|
-
- test/formatter_test.rb
|
140
|
-
- test/jstdutil_test.rb
|
141
|
-
- test/jstestdriver_config_test.rb
|
142
|
-
- test/jstestdriver_test.rb
|
143
|
-
- test/redgreen_test.rb
|
144
|
-
- test/test_file_test.rb
|
145
|
-
- test/test_helper.rb
|
140
|
+
test_files: []
|
141
|
+
|