mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Prefer protected over private attributes
This commit is contained in:
parent
2a7389ef69
commit
198570db2c
24 changed files with 24 additions and 24 deletions
|
@ -180,7 +180,7 @@ module Shoulda
|
||||||
"have :#{method_name} as a #{kind}_#{callback_type}"
|
"have :#{method_name} as a #{kind}_#{callback_type}"
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
def callbacks
|
def callbacks
|
||||||
controller_class._process_action_callbacks.select do |callback|
|
controller_class._process_action_callbacks.select do |callback|
|
||||||
|
|
|
@ -67,7 +67,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
alias failure_message_for_should_not failure_message_when_negated
|
alias failure_message_for_should_not failure_message_when_negated
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :controller, :exception, :expected_method, :handlers
|
attr_reader :controller, :exception, :expected_method, :handlers
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :args
|
attr_reader :args
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
alias failure_message_for_should_not failure_message_when_negated
|
alias failure_message_for_should_not failure_message_when_negated
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :controller, :double_collection, :action, :verb,
|
attr_reader :controller, :double_collection, :action, :verb,
|
||||||
:request_params, :expected_permitted_params, :context
|
:request_params, :expected_permitted_params, :context
|
||||||
|
|
|
@ -237,7 +237,7 @@ module Shoulda
|
||||||
message_finder.allow_description(allowed_values)
|
message_finder.allow_description(allowed_values)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_accessor :values_to_match, :message_finder_factory,
|
attr_accessor :values_to_match, :message_finder_factory,
|
||||||
:instance, :attribute_to_set, :attribute_to_check_message_against,
|
:instance, :attribute_to_set, :attribute_to_check_message_against,
|
||||||
|
|
|
@ -46,7 +46,7 @@ module Shoulda
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :allow_matcher
|
attr_reader :allow_matcher
|
||||||
end
|
end
|
||||||
|
|
|
@ -68,7 +68,7 @@ module Shoulda
|
||||||
failure.nil?
|
failure.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :subject
|
attr_reader :subject
|
||||||
|
|
||||||
|
|
|
@ -855,7 +855,7 @@ module Shoulda
|
||||||
submatchers_match?
|
submatchers_match?
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :submatchers, :missing, :subject, :macro, :name, :options
|
attr_reader :submatchers, :missing, :subject, :macro, :name, :options
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_accessor :subject, :counter_cache, :name
|
attr_accessor :subject, :counter_cache, :name
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_accessor :subject, :dependent, :name
|
attr_accessor :subject, :dependent, :name
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_accessor :subject, :inverse_of, :name
|
attr_accessor :subject, :inverse_of, :name
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :reflection, :subject
|
attr_reader :reflection, :subject
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :subject, :name
|
attr_reader :subject, :name
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :reflector
|
attr_reader :reflector
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_accessor :subject, :order, :name
|
attr_accessor :subject, :order, :name
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_accessor :subject, :source, :name
|
attr_accessor :subject, :source, :name
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_accessor :through, :name, :subject
|
attr_accessor :through, :name, :subject
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :klass, :method_name, :implementation, :original_method
|
attr_reader :klass, :method_name, :implementation, :original_method
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :klass, :doubles_by_method_name
|
attr_reader :klass, :doubles_by_method_name
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Shoulda
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :calls_by_method_name
|
attr_reader :calls_by_method_name
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,7 +22,7 @@ module Shoulda
|
||||||
double.call_original_method(object, args, block)
|
double.call_original_method(object, args, block)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :stub_implementation
|
attr_reader :stub_implementation
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ module Shoulda
|
||||||
implementation.call(object, args, block)
|
implementation.call(object, args, block)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader :implementation
|
attr_reader :implementation
|
||||||
end
|
end
|
||||||
|
|
|
@ -171,7 +171,7 @@ module Shoulda
|
||||||
end
|
end
|
||||||
alias failure_message_for_should_not failure_message_when_negated
|
alias failure_message_for_should_not failure_message_when_negated
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
attr_reader \
|
attr_reader \
|
||||||
:delegated_arguments,
|
:delegated_arguments,
|
||||||
|
|
|
@ -17,7 +17,7 @@ module Shoulda
|
||||||
args == received_arguments
|
args == received_arguments
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
protected
|
||||||
|
|
||||||
def stub_method(method)
|
def stub_method(method)
|
||||||
class_eval do
|
class_eval do
|
||||||
|
|
Loading…
Reference in a new issue