jstdutil 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +3 -0
- data/VERSION +1 -1
- data/lib/jstdutil/test_file.rb +1 -1
- data/test/test_file_test.rb +14 -0
- metadata +3 -3
data/Changelog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.12
|
data/lib/jstdutil/test_file.rb
CHANGED
@@ -12,7 +12,7 @@ module Jstdutil
|
|
12
12
|
def test_files
|
13
13
|
return @test_files if @test_files
|
14
14
|
|
15
|
-
if @file =~ /([-_]test[^\/]+)|([^\/]+[-_]test)\.js/
|
15
|
+
if @file =~ /([-_]test[^\/]+)|([^\/]+[-_]test)|(Test)\.js/
|
16
16
|
@test_files = [@file]
|
17
17
|
else
|
18
18
|
name = File.basename(@file).gsub(/([-_]test)|(test[-_])|(\.js)/, "")
|
data/test/test_file_test.rb
CHANGED
@@ -11,6 +11,20 @@ class TestFileTest < Test::Unit::TestCase
|
|
11
11
|
assert_equal [file], test_file.test_files
|
12
12
|
end
|
13
13
|
|
14
|
+
should "be file itself if name is like -test.js" do
|
15
|
+
file = "some-test.js"
|
16
|
+
test_file = Jstdutil::TestFile.new(file)
|
17
|
+
|
18
|
+
assert_equal [file], test_file.test_files
|
19
|
+
end
|
20
|
+
|
21
|
+
should "be file itself if name is like abcTest.js" do
|
22
|
+
file = "someThingTest.js"
|
23
|
+
test_file = Jstdutil::TestFile.new(file)
|
24
|
+
|
25
|
+
assert_equal [file], test_file.test_files
|
26
|
+
end
|
27
|
+
|
14
28
|
should "find files like _test.js" do
|
15
29
|
file = "some.js"
|
16
30
|
test_file = Jstdutil::TestFile.new(file)
|
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: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 12
|
10
|
+
version: 0.3.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Johansen
|