Permalink
Browse files

fix mongo urls - scheme is mongodb, not mongo (thanks Alex Sharp)

  • Loading branch information...
1 parent 0e1eebc commit f402b142d22b22832140c241d7f8a8894dafdcb0 @pedro pedro committed May 8, 2010
Showing with 6 additions and 6 deletions.
  1. +1 −1 README.md
  2. +1 −1 lib/heroku/command/mongo.rb
  3. +4 −4 spec/mongo_spec.rb
View
2 README.md
@@ -18,7 +18,7 @@ the current Heroku app name.
You can change any of these defining the URL it should connect to, like:
- export MONGO_URL = mongo://user:pass@localhost:1234/db
+ export MONGO_URL = mongodb://user:pass@localhost:1234/db
For production, it will fetch the MONGO_URL from the Heroku app config vars.
View
2 lib/heroku/command/mongo.rb
@@ -57,7 +57,7 @@ def heroku_mongo_uri
end
def local_mongo_uri
- url = ENV['MONGO_URL'] || "mongo://localhost:27017/#{app}"
+ url = ENV['MONGO_URL'] || "mongodb://localhost:27017/#{app}"
make_uri(url)
end
View
8 spec/mongo_spec.rb
@@ -17,7 +17,7 @@
it "rescues exceptions when establishing a connection" do
@mongo.expects(:error)
Mongo::Connection.stubs(:new).raises(Mongo::ConnectionFailure)
- @mongo.send(:make_connection, URI.parse('mongo://localhost'))
+ @mongo.send(:make_connection, URI.parse('mongodb://localhost'))
end
it "rejects urls without host" do
@@ -31,17 +31,17 @@
end
it "fixes mongohq addresses so it can connect from outside EC2" do
- uri = @mongo.send(:make_uri, 'mongo://root:secret@hatch.local.mongohq.com/mydb')
+ uri = @mongo.send(:make_uri, 'mongodb://root:secret@hatch.local.mongohq.com/mydb')
uri.host.should == 'hatch.mongohq.com'
end
describe "Integration test" do
before do
conn = Mongo::Connection.new
@from = conn.db('heroku-mongo-sync-origin')
- @from_uri = URI.parse('mongo://localhost/heroku-mongo-sync-origin')
+ @from_uri = URI.parse('mongodb://localhost/heroku-mongo-sync-origin')
@to = conn.db('heroku-mongo-sync-dest')
- @to_uri = URI.parse('mongo://localhost/heroku-mongo-sync-dest')
+ @to_uri = URI.parse('mongodb://localhost/heroku-mongo-sync-dest')
clear_collections
end

0 comments on commit f402b14

Please sign in to comment.