Module: CouchPotato::RSpec::StubDb

Includes:
RSpec::Mocks::ExampleMethods
Included in:
CouchPotato
Defined in:
lib/couch_potato/rspec/stub_db.rb

Instance Method Summary collapse

Instance Method Details

#stub_db(options = {}) ⇒ Object



46
47
48
49
50
51
# File 'lib/couch_potato/rspec/stub_db.rb', line 46

def stub_db(options = {})
  db = double(:db, options)
  db.extend CouchPotato::RSpec::StubView
  allow(self).to receive(:database) { db }
  db
end