Skip to content
This repository was archived by the owner on Sep 16, 2020. It is now read-only.

bitaculous/mongoid-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fb4ffa4 · Mar 4, 2016

History

42 Commits
Mar 4, 2016
Mar 4, 2016
Mar 4, 2016
Mar 4, 2016
Sep 18, 2015
Nov 9, 2015
Mar 4, 2016
Mar 4, 2016
Sep 18, 2015
Mar 4, 2016
Mar 4, 2016
Nov 9, 2015
Mar 4, 2016
Mar 4, 2016
Mar 4, 2016
Sep 21, 2015
Mar 4, 2016
Mar 4, 2016
Mar 4, 2016
Sep 18, 2015

Repository files navigation

Travis CI Status Code Climate Status Test Coverage Status Gemnasium Status

Cleaner for Mongoid with drop and truncation strategy.

Requirements

Installation

  1. Add Mongoid Cleaner to your Gemfile:

    gem 'mongoid-cleaner', github: 'bitaculous/mongoid-cleaner'
  2. Run bundle to install all dependencies with Bundler

Usage

Mongoid::Cleaner.strategy = 'drop', { only: %w(users) }
Mongoid::Cleaner.clean

Mongoid::Cleaner.strategy = 'truncate', { except: %w(users) }
Mongoid::Cleaner.clean

With Rspec:

RSpec.configure do |config|
  config.before :suite do
    Mongoid::Cleaner.strategy = :drop
  end

  config.around :each do |example|
    Mongoid::Cleaner.cleaning do
      example.run
    end
  end
end

Development

Run specs with RSpec

Run rspec.

or via Guard:

$ guard -g spec

See Test Coverage

Run COVERAGE=true rspec.

Run rubocop.

To run all specs and RuboCop altogether, run rake.

Bug Reports

Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems here.

Credits

All credits goes to team of trommsdorff + drüner, innovation + marketing consultants GmbH for MongoidCleaner, which this Gem is based on.

License

Mongoid Cleaner is released under the MIT License (MIT), see LICENSE.