transactional-factories 0.2.0 → 0.3.0
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 +1 -0
- data/VERSION +1 -1
- data/lib/transactional_factories/test_case.rb +17 -12
- metadata +29 -14
data/Rakefile
CHANGED
@@ -8,6 +8,7 @@ begin
|
|
8
8
|
gem.summary = "Using nested-transactions to allow efficient, programmatic initialization of test data"
|
9
9
|
gem.description = gem.summary
|
10
10
|
gem.email = "tim.harrison@yahoo.com"
|
11
|
+
gem.homepage = "http://open.wested.org/testing/2010/03/22/transactional-factories.html"
|
11
12
|
gem.homepage = "http://github.com/heedspin/transactional-factories"
|
12
13
|
gem.authors = ["Andrew Carpenter", "Tim Harrison"]
|
13
14
|
gem.add_dependency('activesupport', '>= 2.3.2')
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -1,21 +1,25 @@
|
|
1
1
|
module TransactionalFactories
|
2
2
|
module ClassMethods
|
3
3
|
def suite_with_transactions
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|test
|
9
|
-
|
10
|
-
|
4
|
+
if use_transactional_factories.is_a?(FalseClass)
|
5
|
+
suite_without_transactions
|
6
|
+
else
|
7
|
+
method_names = public_instance_methods(true)
|
8
|
+
tests = method_names.delete_if {|method_name| method_name !~ /^test./}
|
9
|
+
suite = TransactionalFactories::TestSuite.new(name)
|
10
|
+
tests.sort.each do
|
11
|
+
|test|
|
12
|
+
catch(:invalid_test) do
|
13
|
+
suite << new(test)
|
14
|
+
end
|
11
15
|
end
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
if (suite.empty?)
|
17
|
+
catch(:invalid_test) do
|
18
|
+
suite << new("default_test")
|
19
|
+
end
|
16
20
|
end
|
21
|
+
return suite
|
17
22
|
end
|
18
|
-
return suite
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
@@ -23,6 +27,7 @@ module TransactionalFactories
|
|
23
27
|
class << klass
|
24
28
|
include ClassMethods
|
25
29
|
alias_method_chain 'suite', 'transactions'
|
30
|
+
cattr_accessor :use_transactional_factories
|
26
31
|
end
|
27
32
|
end
|
28
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transactional-factories
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Andrew Carpenter
|
@@ -10,29 +15,37 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2010-
|
18
|
+
date: 2010-10-13 00:00:00 -07:00
|
14
19
|
default_executable:
|
15
20
|
dependencies:
|
16
21
|
- !ruby/object:Gem::Dependency
|
17
22
|
name: activesupport
|
18
|
-
|
19
|
-
|
20
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
25
|
requirements:
|
22
26
|
- - ">="
|
23
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 2
|
30
|
+
- 3
|
31
|
+
- 2
|
24
32
|
version: 2.3.2
|
25
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
26
35
|
- !ruby/object:Gem::Dependency
|
27
36
|
name: activerecord
|
28
|
-
|
29
|
-
|
30
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
39
|
requirements:
|
32
40
|
- - ">="
|
33
41
|
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 2
|
44
|
+
- 3
|
45
|
+
- 2
|
34
46
|
version: 2.3.2
|
35
|
-
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
36
49
|
description: Using nested-transactions to allow efficient, programmatic initialization of test data
|
37
50
|
email: tim.harrison@yahoo.com
|
38
51
|
executables: []
|
@@ -43,6 +56,7 @@ extra_rdoc_files:
|
|
43
56
|
- LICENSE-MIT
|
44
57
|
- README.rdoc
|
45
58
|
files:
|
59
|
+
- LICENSE-MIT
|
46
60
|
- README.rdoc
|
47
61
|
- Rakefile
|
48
62
|
- VERSION
|
@@ -53,7 +67,6 @@ files:
|
|
53
67
|
- test/lib/blog_post.rb
|
54
68
|
- test/lib/test_helper.rb
|
55
69
|
- test/unit/blog_post_test.rb
|
56
|
-
- LICENSE-MIT
|
57
70
|
has_rdoc: true
|
58
71
|
homepage: http://github.com/heedspin/transactional-factories
|
59
72
|
licenses: []
|
@@ -67,18 +80,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
80
|
requirements:
|
68
81
|
- - ">="
|
69
82
|
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 0
|
70
85
|
version: "0"
|
71
|
-
version:
|
72
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
87
|
requirements:
|
74
88
|
- - ">="
|
75
89
|
- !ruby/object:Gem::Version
|
90
|
+
segments:
|
91
|
+
- 0
|
76
92
|
version: "0"
|
77
|
-
version:
|
78
93
|
requirements: []
|
79
94
|
|
80
95
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.3.
|
96
|
+
rubygems_version: 1.3.6
|
82
97
|
signing_key:
|
83
98
|
specification_version: 3
|
84
99
|
summary: Using nested-transactions to allow efficient, programmatic initialization of test data
|