etest-unit 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/etest-unit/version.rb +1 -1
- data/lib/etest-unit.rb +21 -1
- metadata +2 -2
data/lib/etest-unit/version.rb
CHANGED
data/lib/etest-unit.rb
CHANGED
@@ -6,6 +6,26 @@ require File.dirname(__FILE__) + "/module_ext"
|
|
6
6
|
require "test/unit/ui/console/testrunner"
|
7
7
|
|
8
8
|
module Etest
|
9
|
+
class TestRunner < Test::Unit::UI::Console::TestRunner
|
10
|
+
def setup_mediator
|
11
|
+
super
|
12
|
+
@mediator = Etest::TestRunnerMediator.new(@suite)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class TestRunnerMediator < Test::Unit::UI::TestRunnerMediator
|
17
|
+
def run
|
18
|
+
if defined?(ActiveRecord)
|
19
|
+
ActiveRecord::Base.transaction do
|
20
|
+
super
|
21
|
+
raise ActiveRecord::Rollback, "Rollback test transaction"
|
22
|
+
end
|
23
|
+
else
|
24
|
+
super
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
9
29
|
class TestCase < Test::Unit::TestCase
|
10
30
|
def self.etest=(etest)
|
11
31
|
include @etest = etest
|
@@ -21,7 +41,7 @@ module Etest
|
|
21
41
|
def self.run(etest)
|
22
42
|
test_case_klass = Class.new(TestCase)
|
23
43
|
test_case_klass.etest = etest
|
24
|
-
|
44
|
+
TestRunner.new(test_case_klass).start
|
25
45
|
end
|
26
46
|
end
|
27
47
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etest-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -53,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
segments:
|
55
55
|
- 0
|
56
|
-
hash:
|
56
|
+
hash: 2430133208310339074
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
58
|
none: false
|
59
59
|
requirements:
|