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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e4679ff0187eb29f8abb0adc3f9b5fc8cb635c0512204e52e6b29b2c8e5c22b
4
- data.tar.gz: 7909c015b6d80d9997aa291c62923e8afb78e23207dee2c68b5f377ead3e201a
3
+ metadata.gz: 2c4441c7dbd6c2cc1cfdf107f21c8da0c6ce37e1310f0af99621c15cb572ef26
4
+ data.tar.gz: 7237695bdb925e6488e217c652db69b2a3d24cbb89cb678f7aaf64f7f8794663
5
5
  SHA512:
6
- metadata.gz: 1728e0a96edbbacf2d121903607d29c2ba5bf89effdff549c42fbc651c473eaaacffe028caf55065a69973a4abbae7ddb0a3b87458fe66ee2b72da1f79cd0ec6
7
- data.tar.gz: 783a9d8e793464912ef399ef34fff7949bb44c02597eb91c4ba05f56dc0072e551a58813b7abacf11111750c3f21ca77a509f8e71e421479185628bc3c698132
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:
@@ -73,11 +73,11 @@ module FluentFixtures::DSL
73
73
  ###
74
74
  ### Example:
75
75
  ###
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"} ) { ... }
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 ]
@@ -27,7 +27,7 @@ module FluentFixtures
27
27
  VERSION = '0.7.0'
28
28
 
29
29
  # Version control revision
30
- REVISION = %q$Revision: a7a6e88dd27a $
30
+ REVISION = %q$Revision: fd705f7880a5 $
31
31
 
32
32
 
33
33
  # Loggability API -- set up a named logger
@@ -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.pre.20180612160111
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: 1.3.1
237
+ version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
240
  rubygems_version: 2.7.6
metadata.gz.sig CHANGED
Binary file