entity_store 0.2.5 → 0.2.6

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: 3a6c968a76174464df504ba066b740a0405ed519
4
- data.tar.gz: 9ac5b84c3e500bca9e2b16c949db123ee8225122
3
+ metadata.gz: 052a7001f93a43e4ae8c511c24d5c38a68da7b52
4
+ data.tar.gz: fb2de290d23c3302760094e4d1e3cc20293f7f5c
5
5
  SHA512:
6
- metadata.gz: 373fb189a61ca98dad89e50dda21ee03be838159abed11fa2255325a4cea71a080ff6e5da0fe317368cbaf06f378b5d1f7f9893dfb085ac8f8e7da46416e0e4d
7
- data.tar.gz: ad0387bfa12e52ba90358cef7010fd2c62e85a20b9b11bce562a27847178f35e679d29001ffefb9db5807dd2aeaf47bbe301e5d16f9fa7139d05de5d6bf9c0b7
6
+ metadata.gz: 17ea22adc9908daffd9b06a2e5050f8b26719da3e5eb8f044d88793481ec191aa1d3eb0f575864bf7a1149a4bd21f07411c51f9ddd331c0a8366d80c274be68a
7
+ data.tar.gz: 803f25ab786ec3175c747fa923c7ac211c20df2826e7f8e4691507745051364ec3e516485b2798e318b6ee9ab585d1a03809ede057bdf1f7f02e358d12a54d43
@@ -15,7 +15,7 @@ module EntityStore
15
15
  end
16
16
 
17
17
  def database
18
- @_database ||= URI.parse(MongoEntityStore.connection_profile).path.gsub(/^\//, '')
18
+ @_database ||= MongoEntityStore.connection_profile.split('/').last
19
19
  end
20
20
  end
21
21
 
@@ -1,3 +1,3 @@
1
1
  module EntityStore
2
- VERSION = "0.2.5".freeze
2
+ VERSION = "0.2.6".freeze
3
3
  end
@@ -12,9 +12,9 @@ end
12
12
  describe Entity do
13
13
  describe ".related_entities" do
14
14
  before(:each) do
15
- @entity_loader = mock(Store)
16
- @club = mock('Entity', :id => random_string)
17
- @user = mock('Entity', :id => random_string)
15
+ @entity_loader = double(Store)
16
+ @club = double('Entity', :id => random_string)
17
+ @user = double('Entity', :id => random_string)
18
18
  @entity = DummyEntity.new(:related_entity_loader => @entity_loader, :club_id => @club.id, :user_id => @user.id)
19
19
  @entity_loader.stub(:get) { |id|
20
20
  case id
@@ -27,7 +27,7 @@ describe EventBus do
27
27
  before(:each) do
28
28
  @subscriber = DummySubscriber.new
29
29
  DummySubscriber.stub(:new) { @subscriber }
30
- @subscriber_class2 = mock("SubscriberClass", :instance_methods => ['bilge'], :name => "SubscriberClass")
30
+ @subscriber_class2 = double("SubscriberClass", :instance_methods => ['bilge'], :name => "SubscriberClass")
31
31
  @all_subscriber = DummyAllSubscriber.new
32
32
  DummyAllSubscriber.stub(:new) { @all_subscriber }
33
33
  @event_bus.stub(:subscribers).and_return([DummySubscriber, @subscriber_class2, DummyAllSubscriber])
@@ -56,7 +56,7 @@ describe EventBus do
56
56
 
57
57
  describe ".publish_to_feed" do
58
58
  before(:each) do
59
- @feed_store = mock(ExternalStore)
59
+ @feed_store = double(ExternalStore)
60
60
  @event_bus.stub(:feed_store) { @feed_store }
61
61
  end
62
62
 
@@ -72,10 +72,10 @@ describe EventBus do
72
72
  before(:each) do
73
73
  @since = random_time
74
74
  @type = 'DummyEvent'
75
- @subscriber = mock("Subscriber", :dummy_event => true)
75
+ @subscriber = double("Subscriber", :dummy_event => true)
76
76
  DummySubscriber.stub(:new) { @subscriber }
77
77
 
78
- @feed_store = mock(ExternalStore)
78
+ @feed_store = double(ExternalStore)
79
79
  @id = random_object_id
80
80
  @feed_store.stub(:get_events) { |since| since == @id ? [] : [
81
81
  EventDataObject.new('_id' => @id, '_type' => DummyEvent.name, 'name' => random_string)
@@ -24,10 +24,10 @@ describe MongoEntityStore do
24
24
  }
25
25
  @entity = MongoEntityStoreSpec::DummyEntity.new
26
26
  MongoEntityStoreSpec::DummyEntity.stub(:new) { @entity }
27
- @entities_collection = mock('MongoCollection', :find_one => @attrs)
27
+ @entities_collection = double('MongoCollection', :find_one => @attrs)
28
28
  @store.stub(:entities) { @entities_collection }
29
29
  @events = [
30
- mock('Event', :apply => true, :entity_version => random_integer), mock('Event', :apply => true, :entity_version => random_integer)
30
+ double('Event', :apply => true, :entity_version => random_integer), double('Event', :apply => true, :entity_version => random_integer)
31
31
  ]
32
32
  @store.stub(:get_events) { @events }
33
33
  end
@@ -12,7 +12,7 @@ describe Store do
12
12
  before(:each) do
13
13
  @new_id = random_string
14
14
  @entity = DummyEntityForStore.new(:name => random_string)
15
- @storage_client = mock("StorageClient", :add_entity => @new_id)
15
+ @storage_client = double("StorageClient", :add_entity => @new_id)
16
16
  @store = Store.new
17
17
  @store.stub(:add_events)
18
18
  @store.stub(:storage_client) { @storage_client }
@@ -38,12 +38,12 @@ describe Store do
38
38
  @entity = DummyEntityForStore.new(:name => random_string)
39
39
  @entity.id = random_string
40
40
  @entity.version = random_integer
41
- @entity.pending_events << mock(Event, :entity_id= => true, :entity_version= => true)
42
- @entity.pending_events << mock(Event, :entity_id= => true, :entity_version= => true)
43
- @storage_client = mock("StorageClient", :add_event => true)
41
+ @entity.pending_events << double(Event, :entity_id= => true, :entity_version= => true)
42
+ @entity.pending_events << double(Event, :entity_id= => true, :entity_version= => true)
43
+ @storage_client = double("StorageClient", :add_event => true)
44
44
  @store = Store.new
45
45
  @store.stub(:storage_client) { @storage_client }
46
- @event_bus = mock(EventBus, :publish => true)
46
+ @event_bus = double(EventBus, :publish => true)
47
47
  @store.stub(:event_bus) { @event_bus}
48
48
  end
49
49
 
@@ -82,7 +82,7 @@ describe Store do
82
82
  @entity = DummyEntityForStore.new(:id => random_string)
83
83
  @entity.version = random_integer * EntityStore::Config.snapshot_threshold + 1
84
84
  @store = Store.new
85
- @related_entity = mock('Entity')
85
+ @related_entity = double('Entity')
86
86
  @entity.stub(:loaded_related_entities) { [ @related_entity ] }
87
87
  @store.stub(:do_save)
88
88
  end
@@ -105,11 +105,11 @@ describe Store do
105
105
  @new_id = random_string
106
106
  @entity = DummyEntityForStore.new(:id => random_string)
107
107
  @entity.version = random_integer * EntityStore::Config.snapshot_threshold
108
- @storage_client = mock("StorageClient", :save_entity => true)
108
+ @storage_client = double("StorageClient", :save_entity => true)
109
109
  @store = Store.new
110
110
  @store.stub(:add_events)
111
111
  @store.stub(:storage_client) { @storage_client }
112
- @entity.stub(:pending_events) { [ mock('Event') ] }
112
+ @entity.stub(:pending_events) { [ double('Event') ] }
113
113
  end
114
114
 
115
115
  subject { @store.do_save(@entity) }
@@ -178,11 +178,11 @@ describe Store do
178
178
  @entity = DummyEntityForStore.new(id: random_string, version: random_integer)
179
179
  DummyEntityForStore.stub(:new).and_return(@entity)
180
180
  @events = [
181
- mock("Event", apply: true, entity_version: @entity.version + 1),
182
- mock("Event", apply: true, entity_version: @entity.version + 2)
181
+ double("Event", apply: true, entity_version: @entity.version + 1),
182
+ double("Event", apply: true, entity_version: @entity.version + 2)
183
183
  ]
184
184
 
185
- @storage_client = mock("StorageClient", :get_entity => @entity, :get_events => @events)
185
+ @storage_client = double("StorageClient", :get_entity => @entity, :get_events => @events)
186
186
  @store = Store.new
187
187
  @store.stub(:storage_client) { @storage_client }
188
188
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entity_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Bird
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-01 00:00:00.000000000 Z
11
+ date: 2013-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongo