quicktest 0.6.0 → 0.6.1
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/Rakefile +6 -3
- data/doc/created.rid +1 -1
- data/lib/quicktest.rb +16 -11
- data/spec/test_result.txt +24 -24
- metadata +1 -1
data/Rakefile
CHANGED
@@ -12,8 +12,11 @@ end
|
|
12
12
|
desc "test"
|
13
13
|
task :test do
|
14
14
|
t = 'spec -r ../lib/quicktest test.rb'
|
15
|
-
test_dir
|
16
|
-
|
15
|
+
test_dir do
|
16
|
+
(puts (run "#{t} >| test_result.txt || #{t}"))
|
17
|
+
(puts (run '../bin/quickspec test.rb'))
|
18
|
+
(puts (run '../bin/quickspec __test.rb --quicktest __test'))
|
19
|
+
end
|
17
20
|
end
|
18
21
|
|
19
22
|
namespace :test do
|
@@ -89,7 +92,7 @@ require 'rake/gempackagetask'
|
|
89
92
|
spec = Gem::Specification.new do |s|
|
90
93
|
s.name = $project
|
91
94
|
s.rubyforge_project = $project
|
92
|
-
s.version = "0.6.
|
95
|
+
s.version = "0.6.1"
|
93
96
|
s.author = "Greg Weber"
|
94
97
|
s.email = "greg@gregweber.info"
|
95
98
|
s.homepage = "http://quicktest.rubyfore.org/"
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Mon, 28 Apr 2008
|
1
|
+
Mon, 28 Apr 2008 01:37:50 -0500
|
data/lib/quicktest.rb
CHANGED
@@ -55,10 +55,10 @@ module QuickTest
|
|
55
55
|
self.methods.push meth
|
56
56
|
end
|
57
57
|
|
58
|
-
def initialize tested
|
58
|
+
def initialize tested, included_module=nil
|
59
59
|
self.class.tested_self = tested
|
60
60
|
|
61
|
-
q = tested.method
|
61
|
+
q = tested.method QuickTest.test_method
|
62
62
|
tested.extend(QuickTest.runner_module)
|
63
63
|
QuickTest.runner_module::QuickTestIncludeModules.each do |mod|
|
64
64
|
tested.extend mod
|
@@ -73,10 +73,14 @@ module QuickTest
|
|
73
73
|
tested.send :__quicktest_run_tests__
|
74
74
|
|
75
75
|
# removing the quicktest method will prevent Ruby from warning about the method being redefined
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
if tested.kind_of?(Class) or tested.kind_of?(Module)
|
77
|
+
# TODO: errors for some cases here
|
78
|
+
#class << tested
|
79
|
+
#remove_method QuickTest.test_method
|
80
|
+
#end
|
81
|
+
else
|
82
|
+
tested.class.class_eval { remove_method QuickTest.test_method }
|
83
|
+
end
|
80
84
|
end
|
81
85
|
end
|
82
86
|
|
@@ -141,11 +145,11 @@ module QuickTest
|
|
141
145
|
|
142
146
|
if QuickTest.last_self != self
|
143
147
|
QuickTest.last_self = self
|
144
|
-
QuickTest.include_module_into =
|
148
|
+
QuickTest.include_module_into = Object
|
145
149
|
end
|
146
150
|
|
147
151
|
if traced == QuickTest.test_method
|
148
|
-
|
152
|
+
QuickTest.runner.new self
|
149
153
|
|
150
154
|
elsif traced == :quicktest_include_into
|
151
155
|
QuickTest.include_module_into = self.quicktest_include_into
|
@@ -166,11 +170,11 @@ module QuickTest
|
|
166
170
|
|
167
171
|
if traced == QuickTest.test_method
|
168
172
|
begin
|
169
|
-
qt.runner.new(
|
173
|
+
qt.runner.new( *
|
170
174
|
if self.class != Module
|
171
|
-
self.new
|
175
|
+
[self.new]
|
172
176
|
else
|
173
|
-
Class.new(QuickTest.include_module_into
|
177
|
+
[Class.new(QuickTest.include_module_into).extend(self), self]
|
174
178
|
end
|
175
179
|
)
|
176
180
|
rescue ArgumentError
|
@@ -205,6 +209,7 @@ end
|
|
205
209
|
QuickTest.test_method = :quicktest
|
206
210
|
QuickTest.runner = QuickTest::TestRunner
|
207
211
|
QuickTest.runner_module = QuickTest::RSpecTestRunner
|
212
|
+
QuickTest.include_module_into = Object
|
208
213
|
|
209
214
|
files = []
|
210
215
|
while(arg = ARGV.shift)
|
data/spec/test_result.txt
CHANGED
@@ -1,77 +1,77 @@
|
|
1
1
|
.....FFFFFFFFF
|
2
2
|
|
3
3
|
1)
|
4
|
-
'#<Object:
|
4
|
+
'#<Object:0xb7b88424> should show class name in output' FAILED
|
5
5
|
expected: /^'#<Object:0x[^>]+> should show class name in output' FAILED$/,
|
6
6
|
got: nil (using =~)
|
7
7
|
./test.rb:58:in `quicktest'
|
8
|
-
../lib/quicktest.rb:
|
9
|
-
../lib/quicktest.rb:
|
8
|
+
../lib/quicktest.rb:113:in `call'
|
9
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
10
10
|
|
11
11
|
2)
|
12
|
-
'#<Object:
|
12
|
+
'#<Object:0xb7b85d50> new_method_added should show name of added method' FAILED
|
13
13
|
expected: /^'#<Object:0x[^>]+> new_method_added should show name of added method' FAILED$/,
|
14
14
|
got: nil (using =~)
|
15
15
|
./test.rb:68:in `quicktest'
|
16
|
-
../lib/quicktest.rb:
|
17
|
-
../lib/quicktest.rb:
|
16
|
+
../lib/quicktest.rb:113:in `call'
|
17
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
18
18
|
|
19
19
|
3)
|
20
20
|
'TestModule should show class name in output' FAILED
|
21
21
|
expected: /^'TestModule should show class name in output' FAILED$/,
|
22
22
|
got: nil (using =~)
|
23
23
|
./test.rb:78:in `quicktest'
|
24
|
-
../lib/quicktest.rb:
|
25
|
-
../lib/quicktest.rb:
|
24
|
+
../lib/quicktest.rb:113:in `call'
|
25
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
26
26
|
|
27
27
|
4)
|
28
28
|
'TestModule new_singleton_method_added should show class name in output' FAILED
|
29
29
|
expected: /^'TestModule new_singleton_method_added should show class name in output' FAILED$/,
|
30
30
|
got: nil (using =~)
|
31
31
|
./test.rb:89:in `quicktest'
|
32
|
-
../lib/quicktest.rb:
|
33
|
-
../lib/quicktest.rb:
|
32
|
+
../lib/quicktest.rb:113:in `call'
|
33
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
34
34
|
|
35
35
|
5)
|
36
|
-
'#<Class:
|
36
|
+
'#<Class:0xb7b840b8> the_method should include the module into class Object' FAILED
|
37
37
|
expected: /^'#<Class:0x[^>]+> the_method should include the module into class Object' FAILED$/,
|
38
38
|
got: nil (using =~)
|
39
39
|
./test.rb:98:in `quicktest'
|
40
|
-
../lib/quicktest.rb:
|
41
|
-
../lib/quicktest.rb:
|
40
|
+
../lib/quicktest.rb:113:in `call'
|
41
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
42
42
|
|
43
43
|
6)
|
44
44
|
'TestClass should show class name in output' FAILED
|
45
45
|
expected: /^'TestClass should show class name in output' FAILED$/,
|
46
46
|
got: nil (using =~)
|
47
47
|
./test.rb:109:in `quicktest'
|
48
|
-
../lib/quicktest.rb:
|
49
|
-
../lib/quicktest.rb:
|
48
|
+
../lib/quicktest.rb:113:in `call'
|
49
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
50
50
|
|
51
51
|
7)
|
52
|
-
'#<TestClass:
|
52
|
+
'#<TestClass:0xb7b82c54> should show class name in output' FAILED
|
53
53
|
expected: /^'#<TestClass:0x[^>]+> should show class name in output' FAILED$/,
|
54
54
|
got: nil (using =~)
|
55
55
|
./test.rb:116:in `quicktest'
|
56
|
-
../lib/quicktest.rb:
|
57
|
-
../lib/quicktest.rb:
|
56
|
+
../lib/quicktest.rb:113:in `call'
|
57
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
58
58
|
|
59
59
|
8)
|
60
|
-
'#<TestClass:
|
60
|
+
'#<TestClass:0xb7b82268> new_method_added should show name of added method' FAILED
|
61
61
|
expected: /^'#<TestClass:0x[^>]+> new_method_added should show name of added method' FAILED$/,
|
62
62
|
got: nil (using =~)
|
63
63
|
./test.rb:126:in `quicktest'
|
64
|
-
../lib/quicktest.rb:
|
65
|
-
../lib/quicktest.rb:
|
64
|
+
../lib/quicktest.rb:113:in `call'
|
65
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
66
66
|
|
67
67
|
9)
|
68
68
|
'TestClass new_singleton_method_added should show class name in output' FAILED
|
69
69
|
expected: /^'TestClass new_singleton_method_added should show class name in output' FAILED$/,
|
70
70
|
got: nil (using =~)
|
71
71
|
./test.rb:137:in `quicktest'
|
72
|
-
../lib/quicktest.rb:
|
73
|
-
../lib/quicktest.rb:
|
72
|
+
../lib/quicktest.rb:113:in `call'
|
73
|
+
../lib/quicktest.rb:113:in `__quicktest_run_tests__'
|
74
74
|
|
75
|
-
Finished in 0.
|
75
|
+
Finished in 0.051022 seconds
|
76
76
|
|
77
77
|
14 examples, 9 failures
|