Skip to content

Commit

Permalink
respond_to? mast have 2 args: http://ruby-doc.org/core/classes/Object…
Browse files Browse the repository at this point in the history
….html#M000333 Otherwise Rspec stubs do not work
  • Loading branch information
eugenebolshakov authored and Daniel Haran committed May 18, 2009
1 parent 0c99ee6 commit 88224df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_presenter/base.rb
Expand Up @@ -91,7 +91,7 @@ def attributes=(attrs)

# Makes sure that the presenter is accurate about responding to presentable's attributes, even though they are handled by method_missing.
#
def respond_to?(method)
def respond_to?(method, include_private = false)
presented_attribute?(method) || super
end

Expand Down
1 change: 1 addition & 0 deletions test/base_test.rb
Expand Up @@ -125,6 +125,7 @@
expect SignupPresenter.new.to.be.respond_to?(:user_login)
expect SignupPresenter.new.to.be.respond_to?(:user_password_confirmation)
expect SignupPresenter.new.to.be.respond_to?(:valid?) # just making sure i didn't break everything :)
expect SignupPresenter.new.to.be.respond_to?(:nil?, false) # making sure it's possible to pass 2 arguments

expect User.create!(hash_for_user).not.to.be.login_changed? do |user|
s = SignupPresenter.new(:user => user)
Expand Down

0 comments on commit 88224df

Please sign in to comment.