-
-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use autoloading instead of requiring all files up front
- Loading branch information
Showing
15 changed files
with
108 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
require 'shoulda/matchers/action_controller/filter_param_matcher' | ||
require 'shoulda/matchers/action_controller/route_params' | ||
require 'shoulda/matchers/action_controller/set_flash_matcher' | ||
require 'shoulda/matchers/action_controller/render_with_layout_matcher' | ||
require 'shoulda/matchers/action_controller/respond_with_matcher' | ||
require 'shoulda/matchers/action_controller/set_session_matcher' | ||
require 'shoulda/matchers/action_controller/route_matcher' | ||
require 'shoulda/matchers/action_controller/redirect_to_matcher' | ||
require 'shoulda/matchers/action_controller/render_template_matcher' | ||
require 'shoulda/matchers/action_controller/rescue_from_matcher' | ||
require 'shoulda/matchers/action_controller/callback_matcher' | ||
require 'shoulda/matchers/action_controller/permit_matcher' | ||
require 'shoulda/matchers/action_controller/set_session_or_flash_matcher' | ||
require 'shoulda/matchers/action_controller/flash_store' | ||
require 'shoulda/matchers/action_controller/session_store' | ||
|
||
module Shoulda | ||
module Matchers | ||
# This module provides matchers that are used to test behavior within | ||
# controllers. | ||
module ActionController | ||
autoload :CallbackMatcher, 'shoulda/matchers/action_controller/callback_matcher' | ||
autoload :FlashStore, 'shoulda/matchers/action_controller/flash_store' | ||
autoload :FilterParamMatcher, 'shoulda/matchers/action_controller/filter_param_matcher' | ||
autoload :PermitMatcher, 'shoulda/matchers/action_controller/permit_matcher' | ||
autoload :RedirectToMatcher, 'shoulda/matchers/action_controller/redirect_to_matcher' | ||
autoload :RenderTemplateMatcher, 'shoulda/matchers/action_controller/render_template_matcher' | ||
autoload :RenderWithLayoutMatcher, 'shoulda/matchers/action_controller/render_with_layout_matcher' | ||
autoload :RescueFromMatcher, 'shoulda/matchers/action_controller/rescue_from_matcher' | ||
autoload :RouteParams, 'shoulda/matchers/action_controller/route_params' | ||
autoload :SessionStore, 'shoulda/matchers/action_controller/session_store' | ||
autoload :SetFlashMatcher, 'shoulda/matchers/action_controller/set_flash_matcher' | ||
autoload :SetSessionMatcher, 'shoulda/matchers/action_controller/set_session_matcher' | ||
autoload :SetSessionOrFlashMatcher, 'shoulda/matchers/action_controller/set_session_or_flash_matcher' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
require "shoulda/matchers/active_record/association_matcher" | ||
require "shoulda/matchers/active_record/association_matchers" | ||
require "shoulda/matchers/active_record/association_matchers/counter_cache_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/inverse_of_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/join_table_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/order_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/through_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/dependent_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/required_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/optional_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/source_matcher" | ||
require "shoulda/matchers/active_record/association_matchers/model_reflector" | ||
require "shoulda/matchers/active_record/association_matchers/model_reflection" | ||
require "shoulda/matchers/active_record/association_matchers/option_verifier" | ||
require "shoulda/matchers/active_record/have_db_column_matcher" | ||
require "shoulda/matchers/active_record/have_db_index_matcher" | ||
require "shoulda/matchers/active_record/have_implicit_order_column" | ||
require "shoulda/matchers/active_record/have_readonly_attribute_matcher" | ||
require "shoulda/matchers/active_record/have_rich_text_matcher" | ||
require "shoulda/matchers/active_record/have_secure_token_matcher" | ||
require "shoulda/matchers/active_record/serialize_matcher" | ||
require "shoulda/matchers/active_record/accept_nested_attributes_for_matcher" | ||
require "shoulda/matchers/active_record/define_enum_for_matcher" | ||
require "shoulda/matchers/active_record/uniqueness" | ||
require "shoulda/matchers/active_record/validate_uniqueness_of_matcher" | ||
require "shoulda/matchers/active_record/have_attached_matcher" | ||
|
||
module Shoulda | ||
module Matchers | ||
# This module provides matchers that are used to test behavior within | ||
# ActiveRecord classes. | ||
module ActiveRecord | ||
autoload :AcceptNestedAttributesForMatcher, 'shoulda/matchers/active_record/accept_nested_attributes_for_matcher' | ||
autoload :AssociationMatcher, 'shoulda/matchers/active_record/association_matcher' | ||
autoload :AssociationMatchers, 'shoulda/matchers/active_record/association_matchers' | ||
autoload :DefineEnumForMatcher, 'shoulda/matchers/active_record/define_enum_for_matcher' | ||
autoload :HaveAttachedMatcher, 'shoulda/matchers/active_record/have_attached_matcher' | ||
autoload :HaveDbColumnMatcher, 'shoulda/matchers/active_record/have_db_column_matcher' | ||
autoload :HaveDbIndexMatcher, 'shoulda/matchers/active_record/have_db_index_matcher' | ||
autoload :HaveImplicitOrderColumnMatcher, 'shoulda/matchers/active_record/have_implicit_order_column' | ||
autoload :HaveReadonlyAttributeMatcher, 'shoulda/matchers/active_record/have_readonly_attribute_matcher' | ||
autoload :HaveRichText, 'shoulda/matchers/active_record/have_rich_text_matcher' | ||
autoload :HaveSecureTokenMatcher, 'shoulda/matchers/active_record/have_secure_token_matcher' | ||
autoload :SerializeMatcher, 'shoulda/matchers/active_record/serialize_matcher' | ||
autoload :Uniqueness, 'shoulda/matchers/active_record/uniqueness' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
module Shoulda | ||
module Matchers | ||
module ActiveModel | ||
module ActiveRecord | ||
# @private | ||
module Uniqueness | ||
autoload :Model, 'shoulda/matchers/active_record/uniqueness/model' | ||
autoload :Namespace, 'shoulda/matchers/active_record/uniqueness/namespace' | ||
autoload :TestModelCreator, 'shoulda/matchers/active_record/uniqueness/test_model_creator' | ||
autoload :TestModels, 'shoulda/matchers/active_record/uniqueness/test_models' | ||
end | ||
end | ||
end | ||
end | ||
|
||
require 'shoulda/matchers/active_record/uniqueness/model' | ||
require 'shoulda/matchers/active_record/uniqueness/namespace' | ||
require 'shoulda/matchers/active_record/uniqueness/test_model_creator' | ||
require 'shoulda/matchers/active_record/uniqueness/test_models' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'shoulda/matchers/util/word_wrap' | ||
|
||
module Shoulda | ||
module Matchers | ||
# @private | ||
|