Class: DatabaseCleaner::CouchPotato::Truncation

Inherits:
Object
  • Object
show all
Includes:
Generic::Truncation
Defined in:
lib/database_cleaner/couch_potato/truncation.rb

Instance Method Summary collapse

Methods included from Generic::Truncation

included

Constructor Details

#initialize(options = {}) ⇒ Truncation

Returns a new instance of Truncation.



8
9
10
11
12
13
14
15
# File 'lib/database_cleaner/couch_potato/truncation.rb', line 8

def initialize(options = {})
  if options.has_key?(:only) || options.has_key?(:except)
    raise ArgumentError, "The :only and :except options are not available for use with CouchPotato/CouchDB."
  elsif !options.empty?
    raise ArgumentError, "Unsupported option. You specified #{options.keys.join(',')}."
  end
  super
end

Instance Method Details

#cleanObject



17
18
19
# File 'lib/database_cleaner/couch_potato/truncation.rb', line 17

def clean
  database.recreate!
end