Skip to content

Instantly share code, notes, and snippets.

@lifo
Created October 24, 2008 21:16
Show Gist options
  • Save lifo/19586 to your computer and use it in GitHub Desktop.
Save lifo/19586 to your computer and use it in GitHub Desktop.
def test_write_attributes_respect_access_control_exception_message
privatize("title=(value)")
topic = @target.new
topic.title = "Pants"
assert false, "topic.title should raise NoMethodError exception"
rescue NoMethodError => e
assert_equal e.message, "Attempt to call private method"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment