zeevex_cluster 0.3.1 → 0.3.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.
@@ -133,6 +133,7 @@ class ZeevexCluster::Strategy::Cas < ZeevexCluster::Strategy::Base
|
|
133
133
|
def observe
|
134
134
|
token = server.get(key)
|
135
135
|
@current_master = qualifies_for_master?(token) ? token : nil
|
136
|
+
{:master => @current_master, :members => members}
|
136
137
|
end
|
137
138
|
|
138
139
|
protected
|
@@ -35,15 +35,15 @@ describe ZeevexCluster::Coordinator::Memcached do
|
|
35
35
|
context 'basic methods' do
|
36
36
|
subject { clazz.new(default_options.merge(:client => mockery)) }
|
37
37
|
it 'handles add' do
|
38
|
-
mockery.should_receive(:add).with('foo:bar', '
|
38
|
+
mockery.should_receive(:add).with('foo:bar', '12', 30, true).and_return(STORED)
|
39
39
|
subject.add('bar', 12).should == true
|
40
40
|
end
|
41
41
|
it 'handles set' do
|
42
|
-
mockery.should_receive(:set).with('foo:bar', '
|
42
|
+
mockery.should_receive(:set).with('foo:bar', '13', 30, true).and_return(STORED)
|
43
43
|
subject.set('bar', 13).should == true
|
44
44
|
end
|
45
45
|
it 'handles get' do
|
46
|
-
mockery.should_receive(:get).with('foo:bar', true).and_return('
|
46
|
+
mockery.should_receive(:get).with('foo:bar', true).and_return('14')
|
47
47
|
subject.get('bar').should == 14
|
48
48
|
end
|
49
49
|
end
|
@@ -65,7 +65,7 @@ describe ZeevexCluster::Coordinator::Memcached do
|
|
65
65
|
it 'calls block with current value and receive new value' do
|
66
66
|
mockery.should_receive(:cas) do |key, expiration, raw, &block|
|
67
67
|
block.should_not be_nil
|
68
|
-
block.call('
|
68
|
+
block.call('"yeeha"').should == '"yeehayeeha"'
|
69
69
|
STORED
|
70
70
|
end
|
71
71
|
subject.cas('bar', :expiration => 45) do |val|
|
@@ -77,7 +77,7 @@ describe ZeevexCluster::Coordinator::Memcached do
|
|
77
77
|
|
78
78
|
it 'allows block to abort with no change to value' do
|
79
79
|
mockery.stub(:cas) do |*args, &block|
|
80
|
-
block.call '
|
80
|
+
block.call '7'
|
81
81
|
end
|
82
82
|
subject.cas('bar') do |val|
|
83
83
|
raise ZeevexCluster::Coordinator::DontChange
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeevex_cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.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-
|
12
|
+
date: 2013-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: state_machine
|