fluent_fixtures 0.9.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -3
- data/History.md +14 -0
- data/lib/fluent_fixtures/dsl.rb +3 -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 +31 -17
- 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: d8462db55e1d8a4457b83198a1e00870bcf251674af524762c1bc24bee635abb
|
4
|
+
data.tar.gz: defc5eb14f14bfcd60009636d0be5fc9bc02ad078c1e07e4e5dc1af2b951cc7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cfcd6178c5035f58983ca489d21cd42fc0d3598edcfac598668e4d12061437c21544c0a21da478651124ef085f42807a4455e095fe179b7a80777673a014643
|
7
|
+
data.tar.gz: 2d5e8eb43455975b8d6f2ef806de377bd1f8ab4c319bcf8e89986bff79272b79a4d8f60a58c3eb3c40c6ae50a3ee559841f71de9634c5af2bc1355117f5d79db
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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����Ƅ��n�0a��b�b����tl6d��$|�(�@h^1��V1P0�#b��5.V���ck���#J*߅Q9qs�(+�q��W2��N-������r6ɋ�m9� Q�K�܇����BH�|��Ľ�k̯�|���"/��S�W�`�n���5]T���=�
|
3
|
+
u�4f�8�{w���+��|��{.�۵�!q�N��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
|
|
data/lib/fluent_fixtures/dsl.rb
CHANGED
@@ -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
|
-
|
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.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+
|
14
|
-
|
15
|
-
|
13
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ofy9q+az3DHdaUGlmMiZZZqKixDr1KSS9nvh0ZrKMOUL1sWj/IaxrQ
|
31
|
+
RV3y6td14q49t+xnbj00hPlbW7uE2nLJLt2NAoXiE1Nonndz1seB2c6HL79W9fps
|
32
|
+
E/O12pQjCp/aPUZMt8/8tKW31RIy/KP8XO6OTJNWA8A/oNEI0g5p/LmmEtJKWYr1
|
33
|
+
WmEdESlpWhzFECctefIF2lsN9vaOuof57RM77t2otrtcscDtNarIqjZsIyqtDvtL
|
34
|
+
DttITiit0Vwz7bY0
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
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
|
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
|
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.
|
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
|