fluent_fixtures 0.9.0 → 0.10.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.md +6 -0
- data/lib/fluent_fixtures/factory.rb +7 -1
- data/lib/fluent_fixtures.rb +1 -1
- data/spec/fluent_fixtures/factory_spec.rb +32 -0
- data.tar.gz.sig +0 -0
- metadata +29 -15
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cadce4251b00ed5677abb97143eef4fec4620d1d184c574098c285baf27fde2a
|
4
|
+
data.tar.gz: 36ef9c202a398a61360aea328a54566ce2bfa5a1bf33941a13d5257765760470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b99c96cc9967cd9784c506121263fa70d839392c55d3457344958c544bbbaf967fc05f8725798271d7a7fb0638a3898524465207763416ed830fcf44216ecf80
|
7
|
+
data.tar.gz: 25f442ae66c0fc079fb809ec787e7bc9b3efa1cba4a00fabbfd2661a5333b10ee3a31901ce50e8dfbf526bfecd6d87f84a195c285208898f54f17dc95725431e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Release History for fluent_fixtures
|
2
2
|
|
3
3
|
---
|
4
|
+
## v0.10.0 [2022-04-10] Michael Granger <ged@faeriemud.org>
|
5
|
+
|
6
|
+
Enhancements:
|
7
|
+
|
8
|
+
- Fix keyword argument decorators in Ruby 3.0. Thanks to rob.galanakis@gmail.com for the patch.
|
9
|
+
|
4
10
|
|
5
11
|
## v0.9.0 [2020-11-02] Michael Granger <ged@FaerieMUD.org>
|
6
12
|
|
@@ -190,7 +190,13 @@ class FluentFixtures::Factory
|
|
190
190
|
self.apply_prelude( instance, decorator_options[:prelude] ) if decorator_options[:prelude]
|
191
191
|
|
192
192
|
instance = self.try_to_save( instance ) if decorator_options[:presave]
|
193
|
-
|
193
|
+
if args[-1].is_a?(Hash)
|
194
|
+
kwargs = args[-1]
|
195
|
+
args = args[0..-2]
|
196
|
+
else
|
197
|
+
kwargs = {}
|
198
|
+
end
|
199
|
+
instance.instance_exec( *args, **kwargs, &decorator_block )
|
194
200
|
|
195
201
|
return instance
|
196
202
|
end
|
data/lib/fluent_fixtures.rb
CHANGED
@@ -336,6 +336,38 @@ RSpec.describe FluentFixtures::Factory do
|
|
336
336
|
end
|
337
337
|
|
338
338
|
|
339
|
+
it "handles keyword-only decorators" do
|
340
|
+
fixture_module.decorator( :set_fields ) do |name: nil, email: nil|
|
341
|
+
self.name = name
|
342
|
+
self.email = email
|
343
|
+
end
|
344
|
+
|
345
|
+
object = factory.set_fields( name: 'x', email: 'a@b.c' ).instance
|
346
|
+
|
347
|
+
expect( object ).to be_a( fixtured_class )
|
348
|
+
expect( object.name ).to eq( 'x' )
|
349
|
+
expect( object.email ).to eq( 'a@b.c' )
|
350
|
+
expect( object ).to_not be_saved
|
351
|
+
end
|
352
|
+
|
353
|
+
|
354
|
+
it "handles mixed position and keyword decorators" do
|
355
|
+
fixture_module.decorator( :set_fields ) do |arg1, arg2=2, kwarg: nil|
|
356
|
+
self.name = arg1
|
357
|
+
self.email = arg2
|
358
|
+
self.login = kwarg
|
359
|
+
end
|
360
|
+
|
361
|
+
object = factory.set_fields( 'x', 'a@b.c', kwarg: 'mylogin' ).instance
|
362
|
+
|
363
|
+
expect( object ).to be_a( fixtured_class )
|
364
|
+
expect( object.name ).to eq( 'x' )
|
365
|
+
expect( object.email ).to eq( 'a@b.c' )
|
366
|
+
expect( object.login ).to eq( 'mylogin' )
|
367
|
+
expect( object ).to_not be_saved
|
368
|
+
end
|
369
|
+
|
370
|
+
|
339
371
|
describe "enumerator/generator" do
|
340
372
|
|
341
373
|
it "is Enumerable" do
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent_fixtures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
MIID+
|
14
|
-
|
15
|
-
|
13
|
+
MIID+DCCAmCgAwIBAgIBBDANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
14
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMjAxMDcyMzU4MTRaFw0yMzAxMDcyMzU4
|
15
|
+
MTRaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
16
16
|
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
17
17
|
L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZxkSUuWcP/sFhDXL1lWUuIl
|
18
18
|
M4uHbGCRmOshDrF4dgnBeOvkHr1fIhPlJm5FO+Vew8tSQmlDsosxLUx+VB7DrVFO
|
@@ -23,17 +23,17 @@ cert_chain:
|
|
23
23
|
ozilJg4aar2okb/RA6VS87o+d7g6LpDDMMQjH4G9OPnJENLdhu8KnPw/ivSVvQw7
|
24
24
|
N2I4L/ZOIe2DIVuYH7aLHfjZDQv/mNgpAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYD
|
25
25
|
VR0PBAQDAgSwMB0GA1UdDgQWBBRyjf55EbrHagiRLqt5YAd3yb8k4DANBgkqhkiG
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
26
|
+
9w0BAQsFAAOCAYEASrm1AbEoxACZ9WXJH3R5axV3U0CA4xaETlL2YT+2nOfVBMQ9
|
27
|
+
0ZlkPx6j4ghKJgAIi1TMfDM2JyPJsppQh8tiNccDjWc62UZRY/dq26cMqf/lcI+a
|
28
|
+
6YBuEYvzZfearwVs8tHnXtwYV3WSCoCOQaB+nq2lA1O+nkKNl41WOsVbNama5jx3
|
29
|
+
8cQtVSEEmZy6jIDJ8c5TmBJ7BQUDEUEWA/A3V42Xyctoj7DvUXWE0lP+X6ypAVSr
|
30
|
+
lFh3TS64D7NTvxkmg7natUoCvobl6kGl4yMaqE4YRTlfuzhpf91TSOntClqrAOsS
|
31
|
+
K1s56WndQj3IoBocdY9mQhDZLtLHofSkymoP8btBlj5SsN24TiF0VMSZlctSCYZg
|
32
|
+
GKyHim/MMlIfGOWsgfioq5jzwmql7W4CDubbb8Lkg70v+hN2E/MnNVAcNE3gyaGc
|
33
|
+
P5YP5BAbNW+gvd3QHRiWTTuhgHrdDnGdXg93N2M5KHn1ug8BtPLQwlcFwEpKnlLn
|
34
|
+
btEP+7EplFuoiMfd
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
36
|
+
date: 2022-04-10 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: faker
|
@@ -105,6 +105,20 @@ dependencies:
|
|
105
105
|
- - "~>"
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0.4'
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
name: i18n
|
110
|
+
requirement: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: 1.8.11
|
115
|
+
type: :development
|
116
|
+
prerelease: false
|
117
|
+
version_requirements: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: 1.8.11
|
108
122
|
description: FluentFixtures is a toolkit for building testing objects with a fluent
|
109
123
|
interface.
|
110
124
|
email:
|
@@ -155,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
169
|
- !ruby/object:Gem::Version
|
156
170
|
version: '0'
|
157
171
|
requirements: []
|
158
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.3.7
|
159
173
|
signing_key:
|
160
174
|
specification_version: 4
|
161
175
|
summary: FluentFixtures is a toolkit for building testing objects with a fluent interface.
|
metadata.gz.sig
CHANGED
Binary file
|