fluent_fixtures 0.9.0 → 0.11.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: eee92bfee49cce7ea83ea5d38280616573319442d803d1fe427510974abd80f9
4
- data.tar.gz: cc0c25b2f87b7033b01fdd1c47b83915046f5c782d155c2a91a452491c68c195
3
+ metadata.gz: d8462db55e1d8a4457b83198a1e00870bcf251674af524762c1bc24bee635abb
4
+ data.tar.gz: defc5eb14f14bfcd60009636d0be5fc9bc02ad078c1e07e4e5dc1af2b951cc7f
5
5
  SHA512:
6
- metadata.gz: 42d8f738f4c4bafdd1a750c3229faee3cb68493a2392420004f09c3f795ebda4e0a54552d358e0d93442af6c52971a2d47a6a79507617a1f17fa3242e1c6b5b6
7
- data.tar.gz: 56f682e25e373a04d5426471a3b5c8dea7fc50376f56c9a6a63e44c155955497fe3ecb6d404989769b7f68e1f71f8bcf4b1811dddabc8aaf99f7c450a16a37c1
6
+ metadata.gz: 7cfcd6178c5035f58983ca489d21cd42fc0d3598edcfac598668e4d12061437c21544c0a21da478651124ef085f42807a4455e095fe179b7a80777673a014643
7
+ data.tar.gz: 2d5e8eb43455975b8d6f2ef806de377bd1f8ab4c319bcf8e89986bff79272b79a4d8f60a58c3eb3c40c6ae50a3ee559841f71de9634c5af2bc1355117f5d79db
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- YU�i�w���eO�h���Y�)D�qL|��h��B��(��R��_��2�=�;�?7�|�YZbv5V:�q��p�Fj+
2
- Lߗ�<M4OVVI���Mf|M]����]45\|=wZ��!�2�:Ӊ"�6AB0���J����8%
3
- ����u��(��|.uMǃ�wģ67z��mE@�V�����Sy � ��zs�g�p.����yP�8tw�^>��=�7$U��O84G�=Ɠ��C�'&��Ҋ�U&�,|�lh�A����Z�Q�Y:�b�0iji�w _yŇtK���V��W�ΰ�zg=7�X3J��xq�aR������q7}�`�/�����
1
+ �ɍ�pj���r��V��� ��޹,��� ��x�i�b��7 �^'��`Oe��1zY��~kg6)�-�>j����; ]@�\J\I�ph`��,"
2
+ ,�!\YG&���D-!��Q��&�#JQS/8��d���n�ŏs�^9��������0����Ƅ��n0a��b�b����tl6d��$|�(�@h^1��V1 P0�#b��5.V���ck���#J*߅Q9qs(+�q��W2��N-������r6ɋ�m9� Q�K�܇����BH� |��Ľ�k̯�|���"/��SW�`�n���5]T���=�
3
+ u�4f8{w��� +��|��{.�۵�!qN��u��Q~�lU�Ҭ
data/History.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Release History for fluent_fixtures
2
2
 
3
3
  ---
4
+ ## v0.11.0 [2023-05-09] Michael Granger <ged@faeriemud.org>
5
+
6
+ Enhancements:
7
+
8
+ - Test under Ruby 3.2
9
+ - Update gem-signing cert, dependencies
10
+
11
+
12
+ ## v0.10.0 [2022-04-10] Michael Granger <ged@faeriemud.org>
13
+
14
+ Enhancements:
15
+
16
+ - Fix keyword argument decorators in Ruby 3.0. Thanks to rob.galanakis@gmail.com for the patch.
17
+
4
18
 
5
19
  ## v0.9.0 [2020-11-02] Michael Granger <ged@FaerieMUD.org>
6
20
 
@@ -31,6 +31,9 @@ module FluentFixtures::DSL
31
31
  # Fixture API
32
32
  #
33
33
 
34
+ # :TODO: Add optional args to `base` to pass to the constructor initially, for the case where
35
+ # there are mandatory constructor args.
36
+
34
37
  ### Declare a base fixture for the current module called +name+, with an optional
35
38
  ### initial decorator as a +block+. If no +name+ is given, one is chosen based on the
36
39
  ### name of the declaring module.
@@ -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
- instance.instance_exec( *args, &decorator_block )
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
@@ -24,7 +24,7 @@ module FluentFixtures
24
24
 
25
25
 
26
26
  # Package version
27
- VERSION = '0.9.0'
27
+ VERSION = '0.11.0'
28
28
 
29
29
  # Version control revision
30
30
  REVISION = %q$Revision$
@@ -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.9.0
4
+ version: 0.11.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+DC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CF9+kKEUKohAHOmGsE7OBZFnjMIpH5yUDUVJKByv0gIipFt0
30
- 1T6zff6oVU0w8WBiNKR381+6sF3wIZVnVY0XeJg6hNL+YecE8ILxLhHTmtT/BO0S
31
- 3xPze9uXDR+iD6HYl8KU5QEg/dXFPhfQb512vVkTJDZvMcwu6PxDUjHFChLjAji/
32
- AZXjg1C5E9znTkeUR8ieU9F1MOKoiH57a5lYSTI8Ga8PpsNXTxNeXc16Ob26CqrJ
33
- 83uuAYSy65yXDGXXPVBeKPVnYrqp91pqpS5Nh7wfuiCrE8lgU8PATh7K4BV1UhAT
34
- 0MHbAT42wTYkfUj3
26
+ 9w0BAQsFAAOCAYEARYCeUVBWARNKqF0cvNnLJvFf4hdW2+Rtc7NfC5jQvX9a1oom
27
+ sfVvS96eER/9cbrphu+vc59EELw4zT+RY3/IesnoE7CaX6zIOFmSmG7K61OHsSLR
28
+ KqMygcWwyuPXT2JG7JsGHuxbzgaRWe29HbSjBbLYxiMH8Zxh4tKutxzKF7jb0Ggq
29
+ KAf9MH5LwG8IHVIfV5drT14PvgR3tcvmrn1timPyJl+eZ3LNnm9ofOCweuZCq1cy
30
+ 4Q8LV3vP2Cofy9q+az3DHdaUGlmMiZZZqKixDr1KSS9nvh0ZrKMOUL1sWj/IaxrQ
31
+ RV3y6td14q49t+xnbj00hPlbW7uE2nLJLt2NAoXiE1Nonndz1seB2c6HL79W9fps
32
+ E/O12pQjCp/aPUZMt8/8tKW31RIy/KP8XO6OTJNWA8A/oNEI0g5p/LmmEtJKWYr1
33
+ WmEdESlpWhzFECctefIF2lsN9vaOuof57RM77t2otrtcscDtNarIqjZsIyqtDvtL
34
+ DttITiit0Vwz7bY0
35
35
  -----END CERTIFICATE-----
36
- date: 2020-11-02 00:00:00.000000000 Z
36
+ date: 2023-05-09 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: faker
@@ -41,14 +41,14 @@ dependencies:
41
41
  requirements:
42
42
  - - "~>"
43
43
  - !ruby/object:Gem::Version
44
- version: '2.14'
44
+ version: '3.2'
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - "~>"
50
50
  - !ruby/object:Gem::Version
51
- version: '2.14'
51
+ version: '3.2'
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: inflecto
54
54
  requirement: !ruby/object:Gem::Requirement
@@ -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.1.2
172
+ rubygems_version: 3.4.12
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