mongoid-simplify 0.0.1 → 0.0.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.
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # CHANGELOG
2
+ ## 0.0.2 - unreleased
3
+ + fixed: connection without port specified defaults to 27017
4
+
5
+ ## 0.0.1 - August 31, 2012
6
+ + initial import
@@ -27,7 +27,9 @@ module Mongoid::Simplify::Connection
27
27
  end
28
28
 
29
29
  def mongodb_host(uri)
30
- "#{uri.host}:#{uri.port}"
30
+ host = uri.host
31
+ port = uri.port || "27017"
32
+ "#{host}:#{port}"
31
33
  end
32
34
 
33
35
  def mongodb_database(uri)
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Simplify
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
data/spec/mongoid_spec.rb CHANGED
@@ -1,12 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
- MASTER_URI = "mongodb://localhost:27017/simplify_master"
3
+ MASTER_URI = "mongodb://localhost/simplify_master"
4
4
  SLAVE_URI = "mongodb://localhost:27017/simplify_slave"
5
5
 
6
6
  describe Mongoid::Simplify::Connection do
7
7
 
8
8
  describe "#use" do
9
9
 
10
+ after do
11
+ Mongoid::Config.sessions.clear
12
+ end
13
+
10
14
  describe "when passed an uri as an string" do
11
15
 
12
16
  before do
@@ -19,17 +23,16 @@ describe Mongoid::Simplify::Connection do
19
23
  end
20
24
 
21
25
  it "should have an default session configured" do
26
+ Mongoid::Config.sessions[:default].wont_be_nil
22
27
  Mongoid::Config.sessions.has_key?(:default).must_equal true
28
+ Mongoid::Config.sessions[:default].must_equal :database => 'simplify_master', :hosts => ['localhost:27017']
23
29
  end
24
30
 
25
31
  it "shouldn't have an session named slave configured" do
32
+ Mongoid::Config.sessions[:slave].must_be_nil
26
33
  Mongoid::Config.sessions.has_key?(:slave).must_equal false
27
34
  end
28
35
 
29
- after do
30
- Mongoid::Config.sessions.clear
31
- end
32
-
33
36
  end
34
37
 
35
38
  describe "when passed an list sessions as an array" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-simplify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.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: 2012-08-31 00:00:00.000000000 Z
12
+ date: 2012-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yard
@@ -83,6 +83,7 @@ extensions: []
83
83
  extra_rdoc_files: []
84
84
  files:
85
85
  - .gitignore
86
+ - CHANGELOG.md
86
87
  - Gemfile
87
88
  - LICENSE
88
89
  - README.md