Skip to content

Commit

Permalink
update specs to new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mindreframer committed Oct 27, 2014
1 parent 1927808 commit 0c45ac8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions spec/etcd/client_spec.rb
Expand Up @@ -94,12 +94,12 @@ def base_uri

it 'returns true when the key is successfully changed' do
stub_request(:post, "#{base_uri}/keys/foo").to_return(body: MultiJson.dump({}))
client.update('/foo', 'bar', 'baz').should be_true
client.update('/foo', 'bar', 'baz').should eq(true)
end

it 'returns false when an error is returned' do
stub_request(:post, "#{base_uri}/keys/foo").to_return(status: 400, body: MultiJson.dump({}))
client.update('/foo', 'bar', 'baz').should be_false
client.update('/foo', 'bar', 'baz').should eq(false)
end

it 'sets a TTL when the :ttl option is given' do
Expand Down Expand Up @@ -133,12 +133,12 @@ def base_uri
describe '#exists?' do
it 'returns true if the key has a value' do
stub_request(:get, "#{base_uri}/keys/foo").to_return(body: MultiJson.dump({'value' => 'bar'}))
client.exists?('/foo').should be_true
client.exists?('/foo').should eq(true)
end

it 'returns false if the key does not exist' do
stub_request(:get, "#{base_uri}/keys/foo").to_return(status: 404, body: 'Not found')
client.exists?('/foo').should be_false
client.exists?('/foo').should eq(false)
end
end

Expand All @@ -160,7 +160,7 @@ def base_uri
stub_request(:get, "#{base_uri}/keys/foo").to_return(body: body)
info = client.info('/foo')
info[:key].should == '/foo'
info[:dir].should be_true
info[:dir].should eq(true)
end

it 'returns only the pieces of information that are returned' do
Expand Down
2 changes: 1 addition & 1 deletion spec/etcd/cluster_spec.rb
Expand Up @@ -152,7 +152,7 @@ module Etcd
cluster = Etcd::Cluster.new(cluster_uri)
leader = cluster.leader
leader.etcd.should == cluster_uri
leader.is_leader.should be_true
leader.is_leader.should eq(true)
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/etcd/node_spec.rb
Expand Up @@ -41,17 +41,17 @@ def default_node(opts = {})
node = default_node
stub_request(:get, node.leader_uri).to_return(body: node.raft)
node.update_status
node.is_leader.should be_true
node.is_leader.should eq(true)
end

it "marks leader-flag as :false if leader looses leadership" do
node = default_node
stub_request(:get, node.leader_uri).to_return(body: node.raft)
node.update_status
node.is_leader.should be_true
node.is_leader.should eq(true)
stub_request(:get, node.leader_uri).to_return(body: "bla")
node.update_status
node.is_leader.should be_false
node.is_leader.should eq(false)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/etcd/observer_spec.rb
Expand Up @@ -58,7 +58,7 @@ def base_uri
info[:key].should == '/foo/bar'
info[:value].should == 'bar'
info[:index].should == 3
info[:new_key].should be_true
info[:new_key].should eq(true)
end

it 'yields info about the key, when the key was changed' do
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/etcd_spec.rb
Expand Up @@ -55,8 +55,8 @@

it 'conditionally sets the value for a key' do
client.set(key, 'bar')
client.update(key, 'qux', 'baz').should be_false
client.update(key, 'qux', 'bar').should be_true
client.update(key, 'qux', 'baz').should eq(false)
client.update(key, 'qux', 'bar').should eq(true)
end


Expand Down

0 comments on commit 0c45ac8

Please sign in to comment.