fixtury 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fixtury/test_hooks.rb +8 -5
- data/lib/fixtury/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11c65dc0db10367bf67f7d421ccc76e7b647a5bf73357431bc85dbd788667b00
|
4
|
+
data.tar.gz: 7042ed9b891e4fd0e2bdcade6cc0145160e5fb1dd6394d2bcd8de612ecceb1f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed2b328ac82a6506a9c0d4fb26e049ee249cae994dd4406d2896c0b4be8e270dc54fef1a5f94a887077abc5a9a964a6412bea23bccce7ead21c600c70c2f4374
|
7
|
+
data.tar.gz: 18888bd37fdd508552353f5aa4d076f5bedd4ccf4420d7fc914450dcbaf5ea0c1cb29b428af3c94c3c617fd64359831f43594f65e3e9d300166329e0155e3b11
|
data/Gemfile.lock
CHANGED
data/lib/fixtury/test_hooks.rb
CHANGED
@@ -11,6 +11,9 @@ module Fixtury
|
|
11
11
|
included do
|
12
12
|
class_attribute :fixtury_dependencies
|
13
13
|
self.fixtury_dependencies = Set.new
|
14
|
+
|
15
|
+
class_attribute :local_fixtury_dependencies
|
16
|
+
self.local_fixtury_dependencies = Set.new
|
14
17
|
end
|
15
18
|
|
16
19
|
module ClassMethods
|
@@ -32,7 +35,7 @@ module Fixtury
|
|
32
35
|
|
33
36
|
names.each do |fixture_name|
|
34
37
|
ns.fixture(fixture_name, &definition)
|
35
|
-
self.
|
38
|
+
self.local_fixtury_dependencies += ["/#{namespace}/#{fixture_name}"]
|
36
39
|
end
|
37
40
|
|
38
41
|
# otherwise, just record the dependency
|
@@ -76,7 +79,7 @@ module Fixtury
|
|
76
79
|
name = name.to_s
|
77
80
|
|
78
81
|
local_alias = "/#{self.class.fixtury_namespace}/#{name}"
|
79
|
-
if self.
|
82
|
+
if self.local_fixtury_dependencies.include?(local_alias)
|
80
83
|
return fixtury_store.get(local_alias, execution_context: self)
|
81
84
|
end
|
82
85
|
|
@@ -103,7 +106,7 @@ module Fixtury
|
|
103
106
|
|
104
107
|
# piggybacking activerecord fixture setup for now.
|
105
108
|
def setup_fixtures(*args)
|
106
|
-
if fixtury_dependencies.any?
|
109
|
+
if fixtury_dependencies.any? || local_fixtury_dependencies.any?
|
107
110
|
setup_fixtury_fixtures
|
108
111
|
else
|
109
112
|
super
|
@@ -112,7 +115,7 @@ module Fixtury
|
|
112
115
|
|
113
116
|
# piggybacking activerecord fixture setup for now.
|
114
117
|
def teardown_fixtures(*args)
|
115
|
-
if fixtury_dependencies.any?
|
118
|
+
if fixtury_dependencies.any? || local_fixtury_dependencies.any?
|
116
119
|
teardown_fixtury_fixtures
|
117
120
|
else
|
118
121
|
super
|
@@ -143,7 +146,7 @@ module Fixtury
|
|
143
146
|
end
|
144
147
|
|
145
148
|
def load_all_fixtury_fixtures!
|
146
|
-
fixtury_dependencies.each do |name|
|
149
|
+
(fixtury_dependencies | local_fixtury_dependencies).each do |name|
|
147
150
|
fixtury(name) unless fixtury_loaded?(name)
|
148
151
|
end
|
149
152
|
end
|
data/lib/fixtury/version.rb
CHANGED