public
Rubygem
Description: RSpec extension library for Ruby on Rails
Homepage:
Clone URL: git://github.com/dchelimsky/rspec-rails.git
Only run TestUnitTesting once

Was getting run once from the register_at_exit_hook magic, and once from being 
explicitly called in the spec
Jonathan del Strother (author)
Sat Jul 12 09:04:26 -0700 2008
David Chelimsky (committer)
Thu Jul 17 16:50:10 -0700 2008
commit  6c6e0ded3bd72244bcfdaba854ac5e2e634c8e1d
tree    3efa6d596123aed18173537430df75e6cffbf36b
parent  5d62ea0ed9a4f7c5cba81048ef2af998a5348148
...
13
14
15
 
 
 
 
 
16
17
18
...
23
24
25
 
26
27
28
...
38
39
40
41
 
42
43
44
...
13
14
15
16
17
18
19
20
21
22
23
...
28
29
30
31
32
33
34
...
44
45
46
 
47
48
49
50
0
@@ -13,6 +13,11 @@ if ActiveSupport.const_defined?(:Callbacks) && Test::Unit::TestCase.include?(Act
0
     setup :do_some_setup
0
     teardown :do_some_teardown
0
     
0
+    @@has_been_run = false
0
+    def self.run?
0
+      @@has_been_run
0
+    end
0
+    
0
     def do_some_setup
0
       @@setup_callback_count += 1
0
     end
0
@@ -23,6 +28,7 @@ if ActiveSupport.const_defined?(:Callbacks) && Test::Unit::TestCase.include?(Act
0
     
0
     def test_something
0
       assert_equal true, true
0
+      @@has_been_run = true
0
     end
0
     
0
     def teardown
0
@@ -38,7 +44,7 @@ if ActiveSupport.const_defined?(:Callbacks) && Test::Unit::TestCase.include?(Act
0
     module Unit
0
       describe "Running TestCase tests" do
0
         before(:all) do
0
-          TestUnitTesting.run
0
+          TestUnitTesting.run unless TestUnitTesting.run?
0
         end
0
         
0
         it "should call the setup callbacks" do

Comments