Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

extract validation matchers to minitest-activemodel

  • Loading branch information...
commit 5202ae7873932ac4021659055a96f1d920663978 1 parent 00486c1
@frodsan authored
Showing with 5 additions and 7 deletions.
  1. +2 −0  Gemfile
  2. +2 −7 lib/mongoid-minitest.rb
  3. +1 −0  mongoid-minitest.gemspec
View
2  Gemfile
@@ -1,3 +1,5 @@
source 'https://rubygems.org'
gemspec
+
+gem 'minitest-activemodel', github: 'frodsan/minitest-activemodel'
View
9 lib/mongoid-minitest.rb
@@ -1,19 +1,13 @@
gem 'minitest'
-require 'minitest/matchers'
+require 'minitest-activemodel'
require 'matchers/matcher'
require 'matchers/document/document'
require 'matchers/document/have_field'
require 'matchers/document/be_stored_in'
require 'matchers/document/have_index'
require 'matchers/validations/validations'
-require 'matchers/validations/presence'
-require 'matchers/validations/uniqueness'
-require 'matchers/validations/length'
-require 'matchers/validations/format'
require 'matchers/validations/inclusion'
require 'matchers/validations/exclusion'
-require 'matchers/validations/confirmation'
-require 'matchers/validations/acceptance'
require 'matchers/validations/associated'
require 'matchers/associations/associations'
@@ -22,5 +16,6 @@ module Matchers
include Document
include Validations
include Associations
+ include MiniTest::Matchers::ActiveModel
end
end
View
1  mongoid-minitest.gemspec
@@ -23,5 +23,6 @@ Gem::Specification.new do |gem|
gem.add_dependency 'minitest', '~> 4.1'
gem.add_dependency 'minitest-matchers', '~> 1.2'
gem.add_dependency 'mongoid' , '>= 3'
+ gem.add_dependency 'minitest-activemodel'
gem.add_development_dependency 'rake'
end
Please sign in to comment.
Something went wrong with that request. Please try again.