Skip to content

pueyo5/mongoid-cleaner

 
 

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.

About

Cleaner for Mongoid with drop and truncation strategy.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 97.3%
  • Shell 2.7%