chickadee 5.0.0 → 5.0.1

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
  SHA1:
3
- metadata.gz: 1726fc032c2d71a1ca06823ada526e2ef3aee649
4
- data.tar.gz: 2d5b8838ff00426a79917c7234eeaa559aebd0ee
3
+ metadata.gz: 871e65cb068b6e2eb467213a26ea40286830e230
4
+ data.tar.gz: f230411964c0057999e89a1c57d31eb7d46c2814
5
5
  SHA512:
6
- metadata.gz: cf480054cfee5532a412d6a7b9122dc93cea97ea387c6fd8c4547a11df7cd59812d0cf5b5eaf0761c35351b1702b7cb69aef9b52c090049b12db69385ccd2023
7
- data.tar.gz: 6fa750e4b084847a1231b201a1759e3c1f334b12b0ca49d5bbdfa86e4b8fdbac2b2ae83377b32603738379261062440eb729fa943d2b7aa2b2906e9d18ec819a
6
+ metadata.gz: 392759454c5da3fcbd8923c17a303b0cfd8f9491051d67ac2e85ab81a96b6dba1fe43e03128361d1d73ce71366f7e4c94002ec37a165f85544ada8c8617c5cd8
7
+ data.tar.gz: 4ebd961899eacc991a7fa985b68b3a936c08146a6e32c89bfecfdd7196a2c095a12c53b34ea2075c1cc12d6db8fe5a61c88ab00ae4c32c34ad281b386dc65194
data/chickadee.gemspec CHANGED
@@ -23,5 +23,4 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "mocha", "~> 1.0.0"
26
- spec.add_development_dependency "guard-minitest", "~> 2.2.0"
27
26
  end
@@ -12,6 +12,10 @@ module Chickadee
12
12
  def hydrator
13
13
  @hydrator
14
14
  end
15
+
16
+ def inherited(subclass)
17
+ subclass.set_hydrator(hydrator)
18
+ end
15
19
  end
16
20
 
17
21
  private
@@ -1,3 +1,3 @@
1
1
  module Chickadee
2
- VERSION = "5.0.0"
2
+ VERSION = "5.0.1"
3
3
  end
@@ -0,0 +1,48 @@
1
+ require 'spec_helper'
2
+ require 'chickadee/domain/repository'
3
+
4
+ describe Chickadee::Repository do
5
+ describe '::set_hydrator' do
6
+ it 'assigns hydrator' do
7
+ hydrator = stub
8
+ klass = define_repository_class
9
+ klass.set_hydrator(hydrator)
10
+ klass.hydrator.must_equal(hydrator)
11
+ end
12
+ end
13
+
14
+ describe '::hydrator' do
15
+ it 'returns hydrator' do
16
+ hydrator = stub
17
+ klass = define_repository_class
18
+ klass.set_hydrator(hydrator)
19
+ klass.hydrator.must_equal(hydrator)
20
+ end
21
+ end
22
+
23
+ it 'can inherit hydrator' do
24
+ hydrator = stub
25
+ class1 = Class.new do
26
+ include Chickadee::Repository
27
+ set_hydrator(hydrator)
28
+ end
29
+ class2 = Class.new(class1)
30
+ class2.hydrator.must_equal(hydrator)
31
+ end
32
+
33
+ it 'doesnt share hydrator across classes implementing the module' do
34
+ hydrator = stub
35
+ class1 = Class.new do
36
+ include Chickadee::Repository
37
+ set_hydrator(hydrator)
38
+ end
39
+ class2 = Class.new do
40
+ include Chickadee::Repository
41
+ end
42
+ class2.hydrator.must_be_nil
43
+ end
44
+
45
+ def define_repository_class
46
+ Class.new{include Chickadee::Repository}
47
+ end
48
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chickadee
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Lott
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.0.0
69
- - !ruby/object:Gem::Dependency
70
- name: guard-minitest
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 2.2.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 2.2.0
83
69
  description: Lightweight domain driven design library
84
70
  email:
85
71
  - erik.lott@evrium.com
@@ -99,6 +85,7 @@ files:
99
85
  - lib/chickadee/domain/repository.rb
100
86
  - lib/chickadee/exceptions.rb
101
87
  - lib/chickadee/version.rb
88
+ - spec/domain/repository_spec.rb
102
89
  - spec/spec_helper.rb
103
90
  homepage: ''
104
91
  licenses:
@@ -125,4 +112,5 @@ signing_key:
125
112
  specification_version: 4
126
113
  summary: Lightweight domain driven design library
127
114
  test_files:
115
+ - spec/domain/repository_spec.rb
128
116
  - spec/spec_helper.rb