testrbl 0.1.7 → 0.1.8
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/Gemfile +1 -0
- data/Gemfile.lock +3 -1
- data/lib/testrbl.rb +4 -1
- data/lib/testrbl/version.rb +1 -1
- data/spec/testrbl_spec.rb +41 -17
- metadata +4 -4
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
testrbl (0.1.
|
|
4
|
+
testrbl (0.1.8)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: http://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
+
activesupport (2.3.14)
|
|
9
10
|
diff-lcs (1.1.3)
|
|
10
11
|
minitest (3.0.1)
|
|
11
12
|
rake (0.9.2)
|
|
@@ -28,6 +29,7 @@ PLATFORMS
|
|
|
28
29
|
ruby
|
|
29
30
|
|
|
30
31
|
DEPENDENCIES
|
|
32
|
+
activesupport (= 2.3.14)
|
|
31
33
|
minitest
|
|
32
34
|
rake
|
|
33
35
|
rspec (~> 2)
|
data/lib/testrbl.rb
CHANGED
|
@@ -63,7 +63,10 @@ module Testrbl
|
|
|
63
63
|
if method == "should"
|
|
64
64
|
regex = "#{method} #{regex}\. $"
|
|
65
65
|
elsif method == "test"
|
|
66
|
-
|
|
66
|
+
# test "xxx -_ yyy"
|
|
67
|
+
# test-unit: "test: xxx -_ yyy"
|
|
68
|
+
# activesupport: "test_xxx_-__yyy"
|
|
69
|
+
regex = "^test(: |_)#{regex.gsub(" ", ".")}$"
|
|
67
70
|
elsif method == "it"
|
|
68
71
|
regex = "\\d+_#{test_name.gsub(MINITEST_NAME_RE, '_').downcase}$"
|
|
69
72
|
end
|
data/lib/testrbl/version.rb
CHANGED
data/spec/testrbl_spec.rb
CHANGED
|
@@ -25,11 +25,15 @@ describe Testrbl do
|
|
|
25
25
|
File.open(file, 'w'){|f| f.write content }
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
def read(file)
|
|
29
|
+
File.read(file)
|
|
30
|
+
end
|
|
31
|
+
|
|
28
32
|
it "has a VERSION" do
|
|
29
33
|
Testrbl::VERSION.should =~ /^[\.\da-z]+$/
|
|
30
34
|
end
|
|
31
35
|
|
|
32
|
-
context "
|
|
36
|
+
context "def test_" do
|
|
33
37
|
before do
|
|
34
38
|
write "a_test.rb", <<-RUBY
|
|
35
39
|
require 'test/unit'
|
|
@@ -82,9 +86,8 @@ describe Testrbl do
|
|
|
82
86
|
context "test with string" do
|
|
83
87
|
before do
|
|
84
88
|
write "a_test.rb", <<-RUBY
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class Xxx < Test::Unit::TestCase
|
|
89
|
+
REQUIRE
|
|
90
|
+
class Xxx < ANCESTOR
|
|
88
91
|
test "a" do
|
|
89
92
|
puts 'ABC'
|
|
90
93
|
end
|
|
@@ -93,7 +96,7 @@ describe Testrbl do
|
|
|
93
96
|
puts 'BCD'
|
|
94
97
|
end
|
|
95
98
|
|
|
96
|
-
test "c
|
|
99
|
+
test "c -__.BLA:" do
|
|
97
100
|
puts 'CDE'
|
|
98
101
|
end
|
|
99
102
|
|
|
@@ -104,17 +107,34 @@ describe Testrbl do
|
|
|
104
107
|
RUBY
|
|
105
108
|
end
|
|
106
109
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
[
|
|
111
|
+
["Test::Unit::TestCase", "require 'test/unit'\n"],
|
|
112
|
+
["ActiveSupport::TestCase", "require 'test/unit'\nrequire 'active_support/test_case'"],
|
|
113
|
+
].each do |ancestor, require|
|
|
114
|
+
context "with #{ancestor}" do
|
|
115
|
+
before do
|
|
116
|
+
write("a_test.rb", read("a_test.rb").sub("REQUIRE", require).sub("ANCESTOR", ancestor))
|
|
117
|
+
end
|
|
113
118
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
it "runs test" do
|
|
120
|
+
result = testrbl "a_test.rb:8"
|
|
121
|
+
result.should_not include "ABC\n"
|
|
122
|
+
result.should include "BCD\n"
|
|
123
|
+
result.should_not include "CDE\n"
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
it "runs test explicitly" do
|
|
127
|
+
result = testrbl "a_test.rb:16"
|
|
128
|
+
result.should_not include "CDE\n"
|
|
129
|
+
result.should include "DEF\n"
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
it "runs complex test names" do
|
|
133
|
+
result = testrbl "a_test.rb:12"
|
|
134
|
+
result.should include "CDE\n"
|
|
135
|
+
result.should_not include "DEF\n"
|
|
136
|
+
end
|
|
137
|
+
end
|
|
118
138
|
end
|
|
119
139
|
end
|
|
120
140
|
|
|
@@ -325,11 +345,15 @@ describe Testrbl do
|
|
|
325
345
|
end
|
|
326
346
|
|
|
327
347
|
it "finds calls with single quotes" do
|
|
328
|
-
call(" test 'xx xx' do\n").should == [" ", "^test: xx
|
|
348
|
+
call(" test 'xx xx' do\n").should == [" ", "^test(: |_)xx.xx$"]
|
|
329
349
|
end
|
|
330
350
|
|
|
331
351
|
it "finds test do calls" do
|
|
332
|
-
call(" test \"xx xx\" do\n").should == [" ", "^test: xx
|
|
352
|
+
call(" test \"xx xx\" do\n").should == [" ", "^test(: |_)xx.xx$"]
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
it "finds complex test do calls" do
|
|
356
|
+
call(" test \"c -__.BLA:\" do\n").should == [" ", "^test(: |_)c.\\-__\\.BLA:$"]
|
|
333
357
|
end
|
|
334
358
|
|
|
335
359
|
it "finds should do calls" do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: testrbl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.8
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-06-
|
|
12
|
+
date: 2012-06-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description:
|
|
15
15
|
email: michael@grosser.it
|
|
@@ -44,7 +44,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
44
44
|
version: '0'
|
|
45
45
|
segments:
|
|
46
46
|
- 0
|
|
47
|
-
hash:
|
|
47
|
+
hash: 3374210178778047686
|
|
48
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
49
|
none: false
|
|
50
50
|
requirements:
|
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
53
53
|
version: '0'
|
|
54
54
|
segments:
|
|
55
55
|
- 0
|
|
56
|
-
hash:
|
|
56
|
+
hash: 3374210178778047686
|
|
57
57
|
requirements: []
|
|
58
58
|
rubyforge_project:
|
|
59
59
|
rubygems_version: 1.8.24
|