mack-orm 0.8.2 → 0.8.3
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/lib/mack-orm/test_extensions.rb +20 -22
- metadata +2 -2
@@ -1,6 +1,3 @@
|
|
1
|
-
require "test/unit"
|
2
|
-
require 'spec'
|
3
|
-
|
4
1
|
if Mack.env == "test"
|
5
2
|
module Mack
|
6
3
|
module Testing # :nodoc:
|
@@ -8,9 +5,8 @@ if Mack.env == "test"
|
|
8
5
|
end
|
9
6
|
|
10
7
|
# Wrap it so we don't accidentally alias the run method n times and run out of db connections!
|
11
|
-
|
12
|
-
|
13
|
-
ORM_LOADED = true
|
8
|
+
run_once do
|
9
|
+
|
14
10
|
module Mack
|
15
11
|
module Testing
|
16
12
|
|
@@ -54,26 +50,28 @@ if Mack.env == "test"
|
|
54
50
|
end # Example
|
55
51
|
end # Spec
|
56
52
|
|
57
|
-
|
58
|
-
module
|
59
|
-
|
60
|
-
|
53
|
+
unless v1_9?
|
54
|
+
module Test # :nodoc:
|
55
|
+
module Unit # :nodoc:
|
56
|
+
class TestCase # :nodoc:
|
57
|
+
include Mack::Testing
|
61
58
|
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
# Let's alias the run method in the class above us so we can create a new one here
|
60
|
+
# but still reference it.
|
61
|
+
alias_instance_method :run, :mack_test_case_run # :nodoc:
|
65
62
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
63
|
+
# We need to wrap the run method so we can do things like
|
64
|
+
# run a cleanup method if it exists
|
65
|
+
def run(result, &progress_block) # :nodoc:
|
66
|
+
rollback_transaction do
|
67
|
+
mack_test_case_run(result, &progress_block)
|
68
|
+
end
|
71
69
|
end
|
72
|
-
end
|
73
70
|
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
end # TestCase
|
72
|
+
end # Unit
|
73
|
+
end # Test
|
74
|
+
end
|
77
75
|
|
78
76
|
end
|
79
77
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mack-orm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-01-18 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|