fixture_factory 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fixture_factory/definition.rb +1 -1
- data/lib/fixture_factory/registry.rb +7 -7
- data/lib/fixture_factory/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2400bfa9a06b737fc0c45a0923573c98d5e212fc8819830259032b1dff5c8f4f
|
4
|
+
data.tar.gz: f7188d3a67f00d1274105c200b569739c913c8b8b26c3d14418b9effd7bf0d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 778d52104a7364044668361062da829a01dd69b6532da5ce7c8e4c336001ad92820bac847d6fe2b253b98a65eb8b1f7c027d084f46d97e3d2de86789c4c290e8
|
7
|
+
data.tar.gz: 4970561723810fd451f93cd32f63f77209454cb9f576ad79ba7e5803345f322cdebe3e9695fdd4ae93c43da09fec147bbcf21831a62b65b70c293043c4dfc75c
|
@@ -36,16 +36,16 @@ module FixtureFactory
|
|
36
36
|
# === Example
|
37
37
|
#
|
38
38
|
# define_factories do
|
39
|
-
#
|
40
|
-
#
|
39
|
+
# factory(:user, like: :bob)
|
40
|
+
# factory(:active_user, parent: :user) do
|
41
41
|
# { active: true }
|
42
42
|
# end
|
43
|
-
#
|
43
|
+
# factory(:cool_user, class: 'User') do
|
44
44
|
# { status: :cool }
|
45
45
|
# end
|
46
|
-
#
|
46
|
+
# factory(:admin, via: :users, like: :bob_admin, class: 'User')
|
47
47
|
# end
|
48
|
-
def
|
48
|
+
def factory(name, options = {}, &block)
|
49
49
|
parent = all_factory_definitions[options[:parent]]
|
50
50
|
options[:parent] = parent if options.key?(:parent)
|
51
51
|
options[:block] = block if block
|
@@ -59,12 +59,12 @@ module FixtureFactory
|
|
59
59
|
#
|
60
60
|
# class SomeTest < ActiveSupport::TestCase
|
61
61
|
# define_factories do
|
62
|
-
#
|
62
|
+
# factory(:blog)
|
63
63
|
# end
|
64
64
|
# end
|
65
65
|
#
|
66
66
|
# SomeTest.define_factories do
|
67
|
-
#
|
67
|
+
# factory(:post)
|
68
68
|
# end
|
69
69
|
def define_factories(&block)
|
70
70
|
self.fixture_factory_definitions = {}.with_indifferent_access
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixture_factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -137,7 +137,8 @@ files:
|
|
137
137
|
- lib/fixture_factory/sequence.rb
|
138
138
|
- lib/fixture_factory/version.rb
|
139
139
|
homepage:
|
140
|
-
licenses:
|
140
|
+
licenses:
|
141
|
+
- MIT
|
141
142
|
metadata: {}
|
142
143
|
post_install_message:
|
143
144
|
rdoc_options: []
|