ruby_event_store 0.12.0 → 0.12.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: f8b3cc2b7c28d1128fc89ff122b9a303c3d41f31
4
- data.tar.gz: b41290e98aa40078d9b276e6599049f47d7d051d
3
+ metadata.gz: 977449503b7509bf29e5ed508ecd7eee1423cc9f
4
+ data.tar.gz: 2dc475ea4234c521c9404a2a6468c1c8670289eb
5
5
  SHA512:
6
- metadata.gz: 3669f850d4a535d51804206e5b362e9fee1723faff25ec9c36a5991990ff8ec1a47bba1011bd2d3107b62c735066c3956a351c9f7b3d79cec84385ce989ba722
7
- data.tar.gz: 3158af75dafe4673c3043c82f9b74306f39f9ac1c7fa1899f00f89ce1964dc90a8ba9673957cb5d11a2d0f355300ebb4d5374c13d8f69d30bac25c96c891ec2f
6
+ metadata.gz: 4c64882d002f71d4608508e26c4310045da83dbf502db615d9bba52810f99ce02fb85c30423d609dab4bdbd0775efc2b6e034a3c15ee3098beca863bf0fc0ff6
7
+ data.tar.gz: 7f8743b45d31462da6074ca737f33a1dfc4805035e594d2564d9f8f15cb37fce5964afc30e8b9ba221faf9d8e827084eba883e8e009692ff2d2dfa4ccad08efe
@@ -1,3 +1,7 @@
1
+ ### 0.12.1 (11.08.2016)
2
+
3
+ * Fix: improve EventRepository specification tests (mutation tests)
4
+
1
5
  ### 0.12.0 (10.08.2016)
2
6
 
3
7
  * Change: all public methods arguments with default values are now keyword arguments
@@ -59,25 +59,27 @@ RSpec.shared_examples :event_repository do |repository_class|
59
59
  repository.create(TestDomainEvent.new(event_id: 'event 1'), 'stream')
60
60
  repository.create(TestDomainEvent.new(event_id: 'event 2'), 'stream')
61
61
 
62
- expect(repository.last_stream_event('stream').event_id).to eq('event 2')
62
+ expect(repository.last_stream_event('stream')).to eq(TestDomainEvent.new(event_id: 'event 2'))
63
63
  expect(repository.last_stream_event('other_stream')).to be_nil
64
64
  end
65
65
 
66
66
  it 'reads batch of events from stream forward & backward' do
67
67
  event_ids = (1..10).to_a.map(&:to_s)
68
+ repository.create(TestDomainEvent.new(event_id: '21'), 'other_stream')
68
69
  event_ids.each do |id|
69
70
  repository.create(TestDomainEvent.new(event_id: id), 'stream')
70
71
  end
72
+ repository.create(TestDomainEvent.new(event_id: '22'), 'other_stream')
71
73
 
72
- expect(repository.read_events_forward('stream', :head, 3).map(&:event_id)).to eq ['1','2','3']
73
- expect(repository.read_events_forward('stream', :head, 100).map(&:event_id)).to eq event_ids
74
- expect(repository.read_events_forward('stream', '5', 4).map(&:event_id)).to eq ['6','7','8','9']
75
- expect(repository.read_events_forward('stream', '5', 100).map(&:event_id)).to eq ['6','7','8','9','10']
74
+ expect(repository.read_events_forward('stream', :head, 3)).to eq ['1','2','3'].map{|x| TestDomainEvent.new(event_id: x)}
75
+ expect(repository.read_events_forward('stream', :head, 100)).to eq event_ids.map{|x| TestDomainEvent.new(event_id: x)}
76
+ expect(repository.read_events_forward('stream', '5', 4)).to eq ['6','7','8','9'].map{|x| TestDomainEvent.new(event_id: x)}
77
+ expect(repository.read_events_forward('stream', '5', 100)).to eq ['6','7','8','9','10'].map{|x| TestDomainEvent.new(event_id: x)}
76
78
 
77
- expect(repository.read_events_backward('stream', :head, 3).map(&:event_id)).to eq ['10','9','8']
78
- expect(repository.read_events_backward('stream', :head, 100).map(&:event_id)).to eq event_ids.reverse
79
- expect(repository.read_events_backward('stream', '5', 4).map(&:event_id)).to eq ['4','3','2','1']
80
- expect(repository.read_events_backward('stream', '5', 100).map(&:event_id)).to eq ['4','3','2','1']
79
+ expect(repository.read_events_backward('stream', :head, 3)).to eq ['10','9','8'].map{|x| TestDomainEvent.new(event_id: x)}
80
+ expect(repository.read_events_backward('stream', :head, 100)).to eq event_ids.reverse.map{|x| TestDomainEvent.new(event_id: x)}
81
+ expect(repository.read_events_backward('stream', '5', 4)).to eq ['4','3','2','1'].map{|x| TestDomainEvent.new(event_id: x)}
82
+ expect(repository.read_events_backward('stream', '5', 100)).to eq ['4','3','2','1'].map{|x| TestDomainEvent.new(event_id: x)}
81
83
  end
82
84
 
83
85
 
@@ -88,8 +90,8 @@ RSpec.shared_examples :event_repository do |repository_class|
88
90
  repository.create(TestDomainEvent.new(event_id: '4'), 'other_stream')
89
91
  repository.create(TestDomainEvent.new(event_id: '5'), 'other_stream')
90
92
 
91
- expect(repository.read_stream_events_forward('stream').map(&:event_id)).to eq ['1','3']
92
- expect(repository.read_stream_events_backward('stream').map(&:event_id)).to eq ['3','1']
93
+ expect(repository.read_stream_events_forward('stream')).to eq ['1','3'].map{|x| TestDomainEvent.new(event_id: x)}
94
+ expect(repository.read_stream_events_backward('stream')).to eq ['3','1'].map{|x| TestDomainEvent.new(event_id: x)}
93
95
  end
94
96
 
95
97
  it 'reads batch of events from all streams forward & backward' do
@@ -98,14 +100,14 @@ RSpec.shared_examples :event_repository do |repository_class|
98
100
  repository.create(TestDomainEvent.new(event_id: id), SecureRandom.uuid)
99
101
  end
100
102
 
101
- expect(repository.read_all_streams_forward(:head, 3).map(&:event_id)).to eq ['1','2','3']
102
- expect(repository.read_all_streams_forward(:head, 100).map(&:event_id)).to eq event_ids
103
- expect(repository.read_all_streams_forward('5', 4).map(&:event_id)).to eq ['6','7','8','9']
104
- expect(repository.read_all_streams_forward('5', 100).map(&:event_id)).to eq ['6','7','8','9','10']
103
+ expect(repository.read_all_streams_forward(:head, 3)).to eq ['1','2','3'].map{|x| TestDomainEvent.new(event_id: x)}
104
+ expect(repository.read_all_streams_forward(:head, 100)).to eq event_ids.map{|x| TestDomainEvent.new(event_id: x)}
105
+ expect(repository.read_all_streams_forward('5', 4)).to eq ['6','7','8','9'].map{|x| TestDomainEvent.new(event_id: x)}
106
+ expect(repository.read_all_streams_forward('5', 100)).to eq ['6','7','8','9','10'].map{|x| TestDomainEvent.new(event_id: x)}
105
107
 
106
- expect(repository.read_all_streams_backward(:head, 3).map(&:event_id)).to eq ['10','9','8']
107
- expect(repository.read_all_streams_backward(:head, 100).map(&:event_id)).to eq event_ids.reverse
108
- expect(repository.read_all_streams_backward('5', 4).map(&:event_id)).to eq ['4','3','2','1']
109
- expect(repository.read_all_streams_backward('5', 100).map(&:event_id)).to eq ['4','3','2','1']
108
+ expect(repository.read_all_streams_backward(:head, 3)).to eq ['10','9','8'].map{|x| TestDomainEvent.new(event_id: x)}
109
+ expect(repository.read_all_streams_backward(:head, 100)).to eq event_ids.reverse.map{|x| TestDomainEvent.new(event_id: x)}
110
+ expect(repository.read_all_streams_backward('5', 4)).to eq ['4','3','2','1'].map{|x| TestDomainEvent.new(event_id: x)}
111
+ expect(repository.read_all_streams_backward('5', 100)).to eq ['4','3','2','1'].map{|x| TestDomainEvent.new(event_id: x)}
110
112
  end
111
113
  end
@@ -1,3 +1,3 @@
1
1
  module RubyEventStore
2
- VERSION = '0.12.0'
2
+ VERSION = '0.12.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_event_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2016-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: closed_struct