Sha256: 2a62eedb7c417772d5b38edcb92ac878cb29a4fefb5f6f7f7f3af8c0d631c2b7

Contents?: true

Size: 698 Bytes

Versions: 79

Compression:

Stored size: 698 Bytes

Contents

require 'database_cleaner/generic/truncation'

module DatabaseCleaner
  module CouchPotato
    class Truncation
      include ::DatabaseCleaner::Generic::Truncation

      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

      def clean
        database.recreate!
      end

      private

      def database
        ::CouchPotato.couchrest_database
      end
    end
  end
end

Version data entries

79 entries across 68 versions & 9 rubygems

Version Path
database_cleaner-1.99.0 adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.99.0.beta adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-couch_potato-1.99.0.beta lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.8.5 adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.8.4 adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.8.3 adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.8.2 adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.8.1 adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.8.0 adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-couch_potato-1.8.0 lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.8.0.beta adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-couch_potato-1.8.0.beta lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.7.0 lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.6.2 lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.6.1 lib/database_cleaner/couch_potato/truncation.rb
database_cleaner-1.6.0 lib/database_cleaner/couch_potato/truncation.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/couch_potato/truncation.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/couch_potato/truncation.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/couch_potato/truncation.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/couch_potato/truncation.rb