fixture_kit 0.8.0 → 0.9.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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 88d0180f3f9f71e9ed9546d271dafbd0f29d4b468e0720281a84ddec29757e9a
|
|
4
|
+
data.tar.gz: 1d977134a7bc00fb605110489d3dea4d262cc67bed576dd536c93ea5b1bcd1a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6fea52776d34437dfab5e892d8185d63894bf9f45a8a0dc8c53ff435ef343ce7a3b90891166ef63a760b4c5bcec5a7d6c6a4ab7b4e077f53366a9b2dfcc2563
|
|
7
|
+
data.tar.gz: 2fb7a08b6657e1e23dfe165e919cfd30fbb08b626d40e3ff81672db94795346ec7082afc39d107c17a40ebc79169b9325f60d3e9ef9281b17f73994eceb633d6
|
|
@@ -8,11 +8,10 @@ module FixtureKit
|
|
|
8
8
|
previous_example = ::RSpec.current_example
|
|
9
9
|
previous_scope = ::RSpec.current_scope
|
|
10
10
|
example_group = build_example_group
|
|
11
|
-
example = example_group.example { block.call }
|
|
12
|
-
instance = example_group.new
|
|
11
|
+
example = example_group.example { block.call(self) }
|
|
13
12
|
succeeded =
|
|
14
13
|
begin
|
|
15
|
-
example.run(
|
|
14
|
+
example.run(example_group.new, ::RSpec::Core::NullReporter)
|
|
16
15
|
ensure
|
|
17
16
|
::RSpec.current_example = previous_example
|
|
18
17
|
::RSpec.current_scope = previous_scope
|
data/lib/fixture_kit/cache.rb
CHANGED
|
@@ -54,9 +54,9 @@ module FixtureKit
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def save
|
|
57
|
-
FixtureKit.runner.adapter.execute do
|
|
57
|
+
FixtureKit.runner.adapter.execute do |context|
|
|
58
58
|
models = SqlSubscriber.capture do
|
|
59
|
-
fixture.definition.evaluate
|
|
59
|
+
fixture.definition.evaluate(context)
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
@data = {
|
|
@@ -10,8 +10,9 @@ module FixtureKit
|
|
|
10
10
|
@exposed = {}
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
def evaluate
|
|
14
|
-
|
|
13
|
+
def evaluate(context)
|
|
14
|
+
context.singleton_class.prepend(mixin)
|
|
15
|
+
context.instance_exec(&@definition)
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
def expose(**records)
|
|
@@ -23,5 +24,17 @@ module FixtureKit
|
|
|
23
24
|
@exposed[name] = record
|
|
24
25
|
end
|
|
25
26
|
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def mixin
|
|
31
|
+
definition = self
|
|
32
|
+
|
|
33
|
+
Module.new do
|
|
34
|
+
define_method(:expose) do |**records|
|
|
35
|
+
definition.expose(**records)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
26
39
|
end
|
|
27
40
|
end
|
data/lib/fixture_kit/version.rb
CHANGED