fixturize 0.1.12 → 0.1.13

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.
Files changed (3) hide show
  1. checksums.yaml +5 -13
  2. data/lib/fixturize.rb +8 -1
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YmNmZWRkYTRjZGIwYjY5ZWIwZTMxNTBiODc5MTc2YzgxZThiNmI3ZA==
5
- data.tar.gz: !binary |-
6
- NzgyOWZjZDY3MWI4N2I2ZGRlYjRmMDczZTJkZGRmZTdlNWY4NTNmYg==
2
+ SHA1:
3
+ metadata.gz: 024aceea0b3954ba9b34e87d49e0a51af084d7ac
4
+ data.tar.gz: c713aa1f07210ff24003bd0cbc1a08647c8eab30
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MThiYTdjZjA3OWE0MjQxZTFhOTUyZmQxYmE1MTBkMmQ0Y2VkZTVmYzdlMTVh
10
- OWIzN2M2YjFjYzI4YzZkZDA0Y2FmNTE1YjEyMWMxYjMwN2IzNGJiODE5NzY1
11
- NDBmYWI4MTgyNDc0NTVlYjMwYTMyYjdjNGFlZTljNzJkY2YxOTc=
12
- data.tar.gz: !binary |-
13
- YzJkMmFmM2U2ZmE0MTExYzMzYTRkY2U0MmY1OWM2NjhjOWUxM2RhMGEwZTU1
14
- N2MxMDFlZjc0YzA3MGQyMWM1NjlmMzE3NzExMTQyZjhjNWRmNzFhNjgzYTI3
15
- MjkzMDc5ZDQ3NzM3ZTRlYjExYTBhYzFkZDRkZjQ4YTk1MzQ3NjE=
6
+ metadata.gz: 25c8e785a8443b8b141579df033a1213027ae48de853da56afe4f4cd504bd2b27d1aba63139d6bf335b5c30a136896ca5ade7744560250224b49985fcd8ad408
7
+ data.tar.gz: cf840e37ffd9bcf031f8ffd52d0656365ae99e1d9adf568ebae421811b773e6230971e54220e3857cf9f9840ba936208b1f25fe23ac72066c60ac23931213009
data/lib/fixturize.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'mongo'
2
2
  require 'yaml'
3
3
  require 'set'
4
+ require 'method_source'
5
+ require 'digest/sha1'
4
6
 
5
7
  class Fixturize
6
8
  METHODS_FOR_INSTRUMENTATION = [
@@ -70,7 +72,8 @@ class Fixturize
70
72
  return unless enabled?
71
73
 
72
74
  if name
73
- collection.remove({ :name => name.to_s })
75
+ name = fixture_name(name)
76
+ collection.remove({ :name => name })
74
77
  else
75
78
  collection.drop()
76
79
  end
@@ -92,6 +95,10 @@ class Fixturize
92
95
  end
93
96
 
94
97
  name = [file_name, line_number].join(":")
98
+
99
+ if block.respond_to?(:source)
100
+ name += ":" + Digest::SHA1.hexdigest(block.source.strip)
101
+ end
95
102
  end
96
103
 
97
104
  if !name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixturize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Taylor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-22 00:00:00.000000000 Z
12
+ date: 2015-12-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: fixturize your mongo(mapper) tests inline by caching blocks of created
15
15
  objects
@@ -31,17 +31,17 @@ require_paths:
31
31
  - lib
32
32
  required_ruby_version: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ! '>='
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: '0'
37
37
  required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ! '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.2.2
44
+ rubygems_version: 2.4.8
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: fixturize your mongo tests inline