Sha256: 9b6977f50bcff21d7592e0b6300105fb7cc170567d2ad091b0d3248a4ecc34d9

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

require 'spec_helper'

describe 'Fetcher::Mongoid::Models::Db' do 
  describe '.new' do
    context 'call Fetcher::Mongoid::Models::Db.new' do
      it 'should call ::Mongoid.load!' do
        valid_path = "./config/main.yml"
        ::Mongoid.should_receive(:load!).with(valid_path,:development)
        Fetcher::Mongoid::Models::Db.new valid_path
      end
      it 'should raise an exception when a invalid configuration path is passed' do
        invalid_path = "caca_path"
        expect{
          Fetcher::Mongoid::Models::Db.new valid_path
        }.to raise_error NameError
      end
    end   
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fetcher-mongoid-models-0.0.2 spec/fetcher/mongoid/models/db_spec.rb
fetcher-mongoid-models-0.0.1 spec/fetcher/mongoid/models/db_spec.rb
fetcher-mongoid-models-0.0.0 spec/fetcher/mongoid/models/db_spec.rb