Skip to content

Commit d0d2162

Browse files
author
Sam Phippen
committed
Default include_private using *args in mocks.rb
This is because 1.8.7 does not allow block arguments to have default values.
1 parent 4737ad2 commit d0d2162

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/rspec/rails/mocks.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ def self.primary_key; :id; end
128128
model_class.respond_to?(:column_names) && model_class.column_names.include?(method_name.to_s)
129129
end
130130

131-
msingleton.__send__(:define_method, :respond_to?) do |method_name, include_private=false|
131+
msingleton.__send__(:define_method, :respond_to?) do |method_name, *args|
132+
include_private = args.first || false
132133
__model_class_has_column?(method_name) ? true : super(method_name, include_private)
133134
end unless stubs.has_key?(:respond_to?)
134135

0 commit comments

Comments
 (0)