PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/spec/configuration/database/mongodb_spec.rb

https://github.com/jeffhos/backup
Ruby | 30 lines | 26 code | 3 blank | 1 comment | 8 complexity | ca4e1d9c9ec7f71b78cf7cc0840cc8a9 MD5 | raw file
  1. # encoding: utf-8
  2. require File.dirname(__FILE__) + '/../../spec_helper'
  3. describe Backup::Configuration::Database::MongoDB do
  4. before do
  5. Backup::Configuration::Database::MongoDB.defaults do |db|
  6. db.name = 'mydb'
  7. db.username = 'myuser'
  8. db.password = 'mypassword'
  9. db.host = 'myhost'
  10. db.port = 'myport'
  11. db.only_collections = %w[my other tables]
  12. db.additional_options = %w[my options]
  13. db.ipv6 = true
  14. end
  15. end
  16. it 'should set the default MongoDB configuration' do
  17. db = Backup::Configuration::Database::MongoDB
  18. db.name.should == 'mydb'
  19. db.username.should == 'myuser'
  20. db.password.should == 'mypassword'
  21. db.host.should == 'myhost'
  22. db.port.should == 'myport'
  23. db.only_collections.should == %w[my other tables]
  24. db.additional_options.should == %w[my options]
  25. db.ipv6.should == true
  26. end
  27. end