diff --git a/lib/mongoid-rspec.rb b/lib/mongoid-rspec.rb index ff90a6f..8cd6a4f 100644 --- a/lib/mongoid-rspec.rb +++ b/lib/mongoid-rspec.rb @@ -1,33 +1 @@ -$LOAD_PATH.unshift(File.dirname(__FILE__)) - -require 'mongoid' -require 'rspec/core' -require 'rspec/expectations' -require 'rspec/mocks' -require "active_model" -require 'matchers/document' -require 'matchers/associations' -require 'matchers/collections' -require 'matchers/indexes' -require 'matchers/allow_mass_assignment' -require 'matchers/accept_nested_attributes' -require 'matchers/validations' -require 'matchers/validations/with_message' -require 'matchers/validations/associated' -require 'matchers/validations/confirmation_of' -require 'matchers/validations/exclusion_of' -require 'matchers/validations/format_of' -require 'matchers/validations/inclusion_of' -require 'matchers/validations/length_of' -require 'matchers/validations/numericality_of' -require 'matchers/validations/presence_of' -require 'matchers/validations/uniqueness_of' -require 'matchers/validations/acceptance_of' -require 'matchers/validations/custom_validation_of' - -module Mongoid - module Matchers - include Mongoid::Matchers::Associations - include Mongoid::Matchers::Validations - end -end +require 'mongoid/rspec' diff --git a/lib/mongoid/rspec.rb b/lib/mongoid/rspec.rb new file mode 100644 index 0000000..ff90a6f --- /dev/null +++ b/lib/mongoid/rspec.rb @@ -0,0 +1,33 @@ +$LOAD_PATH.unshift(File.dirname(__FILE__)) + +require 'mongoid' +require 'rspec/core' +require 'rspec/expectations' +require 'rspec/mocks' +require "active_model" +require 'matchers/document' +require 'matchers/associations' +require 'matchers/collections' +require 'matchers/indexes' +require 'matchers/allow_mass_assignment' +require 'matchers/accept_nested_attributes' +require 'matchers/validations' +require 'matchers/validations/with_message' +require 'matchers/validations/associated' +require 'matchers/validations/confirmation_of' +require 'matchers/validations/exclusion_of' +require 'matchers/validations/format_of' +require 'matchers/validations/inclusion_of' +require 'matchers/validations/length_of' +require 'matchers/validations/numericality_of' +require 'matchers/validations/presence_of' +require 'matchers/validations/uniqueness_of' +require 'matchers/validations/acceptance_of' +require 'matchers/validations/custom_validation_of' + +module Mongoid + module Matchers + include Mongoid::Matchers::Associations + include Mongoid::Matchers::Validations + end +end diff --git a/lib/mongoid-rspec/version.rb b/lib/mongoid/rspec/version.rb similarity index 100% rename from lib/mongoid-rspec/version.rb rename to lib/mongoid/rspec/version.rb diff --git a/mongoid-rspec.gemspec b/mongoid-rspec.gemspec index 7323eef..5f4cbcd 100644 --- a/mongoid-rspec.gemspec +++ b/mongoid-rspec.gemspec @@ -1,6 +1,7 @@ # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) -require "mongoid-rspec/version" + +require 'mongoid/rspec/version' Gem::Specification.new do |s| s.name = "mongoid-rspec"