Skip to content

Rspec matchers for Mongoid 5.X and ActiveSupport 4.2.X callbacks

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

nanocity/mongoid-rspec-callbacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongoid-rspec-callbacks

http://rubygems.org/gems/mongoid-rspec-callbacks

RSpec Callbacks matchers for Mongoid 5.x and ActiveSupport 4.2.

This gem is meant to be use with mongoid-rpsec, altought it works by itself.

Syntax is the same as shoulda-callback-matchers.

By now, only on option is supported.

Installation

Add to your Gemfile

gem 'mongoid-rspec'
gem 'mongoid-rspec-callbacks'

Drop in existing or dedicated support file in spec/support (spec/support/mongoid.rb)

RSpec.configure do |configuration|
  configuration.include Mongoid::Matchers
end

Callbacks Matchers

describe User do
  it { should callback(:method).before(:save) }
  it { should callback(:method).after(:save) }
  it { should callback(:method, :method2).before(:validation) }
  it { should callback(:method).after(:validation).on(:create) }
end

About

Rspec matchers for Mongoid 5.X and ActiveSupport 4.2.X callbacks

Resources

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages