/spec/configuration/database/mongodb_spec.rb
Ruby | 30 lines | 26 code | 3 blank | 1 comment | 8 complexity | ca4e1d9c9ec7f71b78cf7cc0840cc8a9 MD5 | raw file
- # encoding: utf-8
- require File.dirname(__FILE__) + '/../../spec_helper'
- describe Backup::Configuration::Database::MongoDB do
- before do
- Backup::Configuration::Database::MongoDB.defaults do |db|
- db.name = 'mydb'
- db.username = 'myuser'
- db.password = 'mypassword'
- db.host = 'myhost'
- db.port = 'myport'
- db.only_collections = %w[my other tables]
- db.additional_options = %w[my options]
- db.ipv6 = true
- end
- end
- it 'should set the default MongoDB configuration' do
- db = Backup::Configuration::Database::MongoDB
- db.name.should == 'mydb'
- db.username.should == 'myuser'
- db.password.should == 'mypassword'
- db.host.should == 'myhost'
- db.port.should == 'myport'
- db.only_collections.should == %w[my other tables]
- db.additional_options.should == %w[my options]
- db.ipv6.should == true
- end
- end