eventus 0.4.1 → 0.4.2

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.
@@ -26,9 +26,10 @@ module Eventus
26
26
  future = @commits.find_one({sid:doc['sid'], max:{:$gte => doc['min']}})
27
27
  raise Eventus::ConcurrencyError if future
28
28
  begin
29
- @commits.insert(doc, w: 2)
29
+ @commits.insert(doc)
30
30
  rescue ::Mongo::OperationFailure => e
31
31
  raise Eventus::ConcurrencyError if e.error_code == 11000
32
+ raise
32
33
  end
33
34
  doc
34
35
  end
@@ -1,3 +1,3 @@
1
1
  module Eventus
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -80,5 +80,12 @@ describe Eventus::Persistence::Mongo do
80
80
  it 'should return nil if there are no events' do
81
81
  persistence.commit([]).should be_nil
82
82
  end
83
+
84
+ it 'should reraise non-"already exists" errors' do
85
+ e = Mongo::OperationFailure.new('fail', 500)
86
+ commits = persistence.instance_eval { @commits }
87
+ commits.stub(:insert) { raise e }
88
+ lambda {persistence.commit create_commit('commitid', 1, "first", "second", "third")}.should raise_error(e)
89
+ end
83
90
  end
84
91
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-25 00:00:00.000000000 Z
12
+ date: 2013-03-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: An Event Store
15
15
  email: