fluent_fixtures 0.7.0.pre.20180612160111 → 0.7.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 +0 -0
- data/History.md +8 -0
- data/lib/fluent_fixtures/dsl.rb +5 -5
- data/lib/fluent_fixtures/factory.rb +2 -1
- data/lib/fluent_fixtures.rb +1 -1
- data/spec/fluent_fixtures/factory_spec.rb +11 -0
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 2c4441c7dbd6c2cc1cfdf107f21c8da0c6ce37e1310f0af99621c15cb572ef26
|
4
|
+
data.tar.gz: 7237695bdb925e6488e217c652db69b2a3d24cbb89cb678f7aaf64f7f8794663
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2574f0db599961962af3cbc9cbea2707d5c4049bd7fd0f51ec477b6240ed33a8ac0bcf1fba07b24e4d3756cc9edc0bfd4774a20b374e1b44ba4a471f03caebf2
|
7
|
+
data.tar.gz: 27783dc76655e384c5e6b11d31d7169f9225d10e5939df0923bb85456be9ea8db70b80c27092d850716221fc8649fdebc47db63fb7a419342809b4963194adc4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## v0.7.0 [2018-06-12] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
Enhancements:
|
4
|
+
|
5
|
+
- Add composed decorators
|
6
|
+
- Raise a more-informative error when invoking a non-existent fixture.
|
7
|
+
|
8
|
+
|
1
9
|
## v0.6.1 [2017-10-30] Michael Granger <ged@FaerieMUD.org>
|
2
10
|
|
3
11
|
Bugfixes:
|
data/lib/fluent_fixtures/dsl.rb
CHANGED
@@ -73,11 +73,11 @@ module FluentFixtures::DSL
|
|
73
73
|
###
|
74
74
|
### Example:
|
75
75
|
###
|
76
|
-
###
|
77
|
-
###
|
78
|
-
###
|
79
|
-
###
|
80
|
-
###
|
76
|
+
### decorator :foo { ... }
|
77
|
+
### decorator :bar { ... }
|
78
|
+
### compose( :simple => :foo ) { ... }
|
79
|
+
### compose( :complex => [:foo, :bar] ) { ... }
|
80
|
+
### compose( :complex_with_args => {foo: [1,2], bar: "Something"} ) { ... }
|
81
81
|
def compose( **hash, &block )
|
82
82
|
name, components = hash.first
|
83
83
|
|
@@ -181,7 +181,8 @@ class FluentFixtures::Factory
|
|
181
181
|
### Apply a decorator declared in the fixture module by the given
|
182
182
|
### +decorator_name+ to the specified +instance+.
|
183
183
|
def apply_named_decorator( instance, args, decorator_name )
|
184
|
-
decorator_block = self.fixture_module.decorators[ decorator_name ]
|
184
|
+
decorator_block = self.fixture_module.decorators[ decorator_name ] or
|
185
|
+
raise "non-existent fixture `%s`" % [ decorator_name ]
|
185
186
|
decorator_options = self.fixture_module.decorator_options[ decorator_name ] || {}
|
186
187
|
self.log.debug "Applying decorator %p (%p - %p) to a %p with args: %p" %
|
187
188
|
[ decorator_name, decorator_block, decorator_options, instance.class, args ]
|
data/lib/fluent_fixtures.rb
CHANGED
@@ -450,6 +450,17 @@ describe FluentFixtures::Factory do
|
|
450
450
|
expect( object.email ).to eq( 'xxxxxx.xxxxxx@xxxxxxx.xxx' )
|
451
451
|
end
|
452
452
|
|
453
|
+
|
454
|
+
it "raises a useful error if composed from a non-existent fixture" do
|
455
|
+
fixture_module.compose( :anonymized => :with_anonymized_email ) do
|
456
|
+
self.name = 'Xxxx Xxxxxxxxx'
|
457
|
+
end
|
458
|
+
|
459
|
+
expect {
|
460
|
+
factory.anonymized.instance
|
461
|
+
}.to raise_error( /non-existent fixture `with_anonymized_email`/i )
|
462
|
+
end
|
463
|
+
|
453
464
|
end
|
454
465
|
|
455
466
|
end
|
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.7.0
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -232,9 +232,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: 2.2.0
|
233
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
234
|
requirements:
|
235
|
-
- - "
|
235
|
+
- - ">="
|
236
236
|
- !ruby/object:Gem::Version
|
237
|
-
version:
|
237
|
+
version: '0'
|
238
238
|
requirements: []
|
239
239
|
rubyforge_project:
|
240
240
|
rubygems_version: 2.7.6
|
metadata.gz.sig
CHANGED
Binary file
|