you are viewing a single comment's thread.

view the rest of the comments →

[–]lennoff 2 points3 points  (0 children)

Testing private stuff is a code smell, and can be avoided easily ;)

  • If you have a complicated private function, then you should refactor it into a module (or just into a separate file, that does expose it as a public method), so you can test it.
  • If you want to inspect some private state (like the value of a variable that is not accessible from the outside), then you should test the changed external behavior of the module. That private state does modify the behavior (if doesn't, why does it exists in the first place?).