rename qwaiter to mozo
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Mozo::Counter do
|
||||
describe 'couchbase connection', broken: true do # couchbase not used at the moment
|
||||
before do
|
||||
@original_connection = Mozo::Counter.connection
|
||||
Mozo::Counter.connection = $cb
|
||||
end
|
||||
|
||||
after do
|
||||
Mozo::Counter.connection = @original_connection
|
||||
end
|
||||
describe '.incr' do
|
||||
it 'sets nonexistent keys to 1' do
|
||||
expect( subject.incr 'nonexistent1' ).to eq 1
|
||||
expect( subject.get 'nonexistent1' ).to eq 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test connection' do
|
||||
describe '.incr' do
|
||||
it 'sets nonexistent keys to 1' do
|
||||
expect( subject.incr 'nonexistent1' ).to eq 1
|
||||
expect( subject.get 'nonexistent1' ).to eq 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
# encoding: UTF-8
|
||||
require 'spec_helper'
|
||||
|
||||
describe Mozo::Distribution do
|
||||
describe 'distribute_lattice' do
|
||||
{
|
||||
[20 , 10, 4] => [10.0, 5.0],
|
||||
[10 , 10, 4] => [ 5.0, 5.0],
|
||||
[20 , 5, 4] => [ 5.0, 5.0],
|
||||
[30 , 10, 4] => [ 7.5, 10.0],
|
||||
[10 , 30, 4] => [10.0, 7.5],
|
||||
[10 , 10, 3] => [ 5.0, 5.0],
|
||||
[13.6, 40, 7] => [ 6.8, 10.0],
|
||||
[13.6, 40, 9] => [ 6.8, 8.0],
|
||||
[13.6, 40, 10] => [ 6.8, 8.0],
|
||||
[40, 40, 23] => [ 8.0, 8.0],
|
||||
}.each do |params, result|
|
||||
it("handles #{params.join(', ')}"){ Mozo::Distribution.distribute_lattice(*params).should == result }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user