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 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 {(puts (run "#{t} >| test_result.txt || #{t}"))}
16
- test_dir { puts `../bin/quickspec __test.rb --quicktest __test` }
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.0"
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/"
@@ -1 +1 @@
1
- Mon, 28 Apr 2008 00:33:03 -0500
1
+ Mon, 28 Apr 2008 01:37:50 -0500
@@ -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(QuickTest.test_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
- # I don't know how to remove a class method
77
- unless tested.kind_of?(Class) or tested.kind_of?(Module)
78
- tested.class.class_eval { remove_method QuickTest.test_method }
79
- end
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 = nil
148
+ QuickTest.include_module_into = Object
145
149
  end
146
150
 
147
151
  if traced == QuickTest.test_method
148
- QuickTest.runner.new self
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 || Object).extend(self)
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)
@@ -1,77 +1,77 @@
1
1
  .....FFFFFFFFF
2
2
 
3
3
  1)
4
- '#<Object:0xb7ba8954> should show class name in output' FAILED
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:109:in `call'
9
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
8
+ ../lib/quicktest.rb:113:in `call'
9
+ ../lib/quicktest.rb:113:in `__quicktest_run_tests__'
10
10
 
11
11
  2)
12
- '#<Object:0xb7ba80a8> new_method_added should show name of added method' FAILED
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:109:in `call'
17
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
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:109:in `call'
25
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
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:109:in `call'
33
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
32
+ ../lib/quicktest.rb:113:in `call'
33
+ ../lib/quicktest.rb:113:in `__quicktest_run_tests__'
34
34
 
35
35
  5)
36
- '#<Class:0xb7ba61f4> the_method should include the module into class Object' FAILED
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:109:in `call'
41
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
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:109:in `call'
49
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
48
+ ../lib/quicktest.rb:113:in `call'
49
+ ../lib/quicktest.rb:113:in `__quicktest_run_tests__'
50
50
 
51
51
  7)
52
- '#<TestClass:0xb7ba47c8> should show class name in output' FAILED
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:109:in `call'
57
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
56
+ ../lib/quicktest.rb:113:in `call'
57
+ ../lib/quicktest.rb:113:in `__quicktest_run_tests__'
58
58
 
59
59
  8)
60
- '#<TestClass:0xb7ba3d64> new_method_added should show name of added method' FAILED
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:109:in `call'
65
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
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:109:in `call'
73
- ../lib/quicktest.rb:109:in `__quicktest_run_tests__'
72
+ ../lib/quicktest.rb:113:in `call'
73
+ ../lib/quicktest.rb:113:in `__quicktest_run_tests__'
74
74
 
75
- Finished in 0.034129 seconds
75
+ Finished in 0.051022 seconds
76
76
 
77
77
  14 examples, 9 failures
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quicktest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Weber