Skip to content

Commit

Permalink
getting rid of deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Aug 30, 2013
1 parent 1e1a432 commit 6225501
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def error_response(attributes)
http_header = double()
http_header.stub(:request_uri).and_return(request_uri)

stub(
double(
http_header: http_header,
code: attributes[:code],
body: {
Expand Down
14 changes: 7 additions & 7 deletions spec/unit/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@ module Neography
context "requests" do

it "does a GET request" do
connection.client.should_receive(:get).with("http://localhost:7474/db/data/foo/bar", nil, nil) { stub.as_null_object }
connection.client.should_receive(:get).with("http://localhost:7474/db/data/foo/bar", nil, nil) { double.as_null_object }
connection.get("/foo/bar")
end

it "does a POST request" do
connection.client.should_receive(:post).with("http://localhost:7474/db/data/foo/bar", nil, nil) { stub.as_null_object }
connection.client.should_receive(:post).with("http://localhost:7474/db/data/foo/bar", nil, nil) { double.as_null_object }
connection.post("/foo/bar")
end

it "does a PUT request" do
connection.client.should_receive(:put).with("http://localhost:7474/db/data/foo/bar", nil, nil) { stub.as_null_object }
connection.client.should_receive(:put).with("http://localhost:7474/db/data/foo/bar", nil, nil) { double.as_null_object }
connection.put("/foo/bar")
end

it "does a DELETE request" do
connection.client.should_receive(:delete).with("http://localhost:7474/db/data/foo/bar", nil, nil) { stub.as_null_object }
connection.client.should_receive(:delete).with("http://localhost:7474/db/data/foo/bar", nil, nil) { double.as_null_object }
connection.delete("/foo/bar")
end

Expand All @@ -110,11 +110,11 @@ module Neography
connection.client.should_receive(:set_auth).with(
"http://localhost:7474/db/data/foo/bar",
"foo",
"bar") { stub.as_null_object }
"bar") { double.as_null_object }

connection.client.should_receive(:get).with(
"http://localhost:7474/db/data/foo/bar", nil, nil
) { stub.as_null_object }
) { double.as_null_object }

connection.get("/foo/bar")
end
Expand All @@ -124,7 +124,7 @@ module Neography
connection.client.should_receive(:get).with(
"http://localhost:7474/db/data/foo/bar",
nil, { "User-Agent" => "Neography/#{Neography::VERSION}", "X-Stream"=>true}
) { stub.as_null_object }
) { double.as_null_object }

connection.get("/foo/bar", :headers => {})
end
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Neography
context "no explicit server" do

before do
@db = mock(Neography::Rest, :is_a? => true).as_null_object
@db = double(Neography::Rest, :is_a? => true).as_null_object
Rest.stub(:new) { @db }
end

Expand Down Expand Up @@ -55,7 +55,7 @@ module Neography

before do
# stub out actual connections
@db = stub(Rest).as_null_object
@db = double(Rest).as_null_object
Rest.stub(:new) { @db }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/properties_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
describe "Properties" do

before do
@db = mock(Neography::Rest, :is_a? => true).as_null_object
@db = double(Neography::Rest, :is_a? => true).as_null_object
Rest.stub(:new) { @db }
end

Expand Down
8 changes: 4 additions & 4 deletions spec/unit/relationship_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Neography
describe Relationship do

let(:db) { stub(Rest).as_null_object }
let(:db) { double(Rest).as_null_object }
let(:relationship_hash) do
{
"self" => "0",
Expand All @@ -13,8 +13,8 @@ module Neography
}
end

let(:from) { stub(:neo_server => db) }
let(:to) { stub(:neo_server => db) }
let(:from) { double(:neo_server => db) }
let(:to) { double(:neo_server => db) }
let(:props) { { :foo => "bar" } }

describe "::create" do
Expand All @@ -40,7 +40,7 @@ module Neography

before do
# stub out actual connections
@db = stub(Rest).as_null_object
@db = double(Rest).as_null_object
Rest.stub(:new) { @db }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/batch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Batch do

let(:connection) { stub(:gremlin_path => "/gremlin", :cypher_path => "/cypher") }
let(:connection) { double(:gremlin_path => "/gremlin", :cypher_path => "/cypher") }
subject { Batch.new(connection) }

it "gets nodes" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/clean_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Clean do

let(:connection) { stub }
let(:connection) { double }
subject { Clean.new(connection) }

it "cleans the database" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/cypher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Cypher do

let(:connection) { stub(:cypher_path => "/cypher") }
let(:connection) { double(:cypher_path => "/cypher") }
subject { Cypher.new(connection) }

it "executes a cypher query" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/extensions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Extensions do

let(:connection) { stub }
let(:connection) { double }
subject { Extensions.new(connection) }

it "executes an extensions get query" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/gremlin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Gremlin do

let(:connection) { stub(:gremlin_path => "/gremlin") }
let(:connection) { double(:gremlin_path => "/gremlin") }
subject { Gremlin.new(connection) }

it "executes a gremlin script" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/labels_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe NodeLabels do

let(:connection) { stub }
let(:connection) { double }
subject { NodeLabels.new(connection) }

it "list node labels" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/node_auto_indexes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe NodeAutoIndexes do

let(:connection) { stub }
let(:connection) { double }
subject { NodeAutoIndexes.new(connection) }

it "gets a node from an auto index" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/node_paths_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe NodePaths do

let(:connection) { stub(:configuration => "http://configuration") }
let(:connection) { double(:configuration => "http://configuration") }
subject { NodePaths.new(connection) }

it "gets a shortest path between two nodes" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/node_properties_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe NodeProperties do

let(:connection) { stub }
let(:connection) { double }
subject { NodeProperties.new(connection) }

it "sets properties" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/node_relationships_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe NodeRelationships do

let(:connection) { stub(:configuration => "http://configuration") }
let(:connection) { double(:configuration => "http://configuration") }
subject { NodeRelationships.new(connection) }

it "creates a relationship" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/node_traversal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe NodeTraversal do

let(:connection) { stub }
let(:connection) { double }
subject { NodeTraversal.new(connection) }

it "traverses" do
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/rest/nodes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Nodes do

let(:connection) { stub }
let(:connection) { double }
subject { Nodes.new(connection) }

context "get nodes" do
Expand Down Expand Up @@ -141,7 +141,7 @@ class Rest

context "#create_multiple_threaded" do

let(:connection) { stub(:max_threads => 2) }
let(:connection) { double(:max_threads => 2) }

it "creates multiple with attributes" do
options1 = {
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/relationship_auto_indexes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe RelationshipAutoIndexes do

let(:connection) { stub }
let(:connection) { double }
subject { RelationshipAutoIndexes.new(connection) }

it "gets a relationship from an auto index" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/relationship_properties_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe RelationshipProperties do

let(:connection) { stub }
let(:connection) { double }
subject { RelationshipProperties.new(connection) }

it "sets properties" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/relationship_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe RelationshipTypes do

let(:connection) { stub(:configuration => "http://configuration") }
let(:connection) { double(:configuration => "http://configuration") }
subject { RelationshipTypes.new(connection) }

it "lists all relationship types" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/relationships_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Relationships do

let(:connection) { stub }
let(:connection) { double }
subject { Relationships.new(connection) }

it "gets a relationship" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/schema_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe SchemaIndexes do

let(:connection) { stub(:configuration => "http://configuration") }
let(:connection) { double(:configuration => "http://configuration") }
subject { SchemaIndexes.new(connection) }

it "create schema indexes" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/transactions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Neography
class Rest
describe Transactions do

let(:connection) { stub(:configuration => "http://configuration") }
let(:connection) { double(:configuration => "http://configuration") }
subject { Transactions.new(connection) }

it "can create new transactions" do
Expand Down

0 comments on commit 6225501

Please sign in to comment.