Private Methods: To Test or Not To Test?
Some say that you should only test your public API. I disagree officially in this blog post that shows pros and cons of testing private methods, too. I’d love to hear your opinions!
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Some say that you should only test your public API. I disagree officially in this blog post that shows pros and cons of testing private methods, too. I’d love to hear your opinions!
Comments
I left a comment on your blog, but here’s my take on the topic: http://blog.rubybestpractices.com/posts/gregory/034-issue-5-testing-antipatterns.html
Basically, I think your argument is that you should test the non-trivial private API of your code (i.e. its internals / developer API). I agree with that, but I disagree that your internal API should be marking its methods as private. Details in the article linked above.
http://www.fitflops.in.net http://www.mlbjerseyscom.us.com http://www.coachoutletclearancesale.us.com http://www.oakleysunglassesoutlet.us.org http://www.seattleseahawksjersey.us http://www.valentinooutletstore.us.com http://www.coach-factoryoutlets.us.com http://www.cheapnhljerseysshop.us.com http://www.moncler.eu.com http://www.yeezyboost.us.com http://www.yeti.us.org qqq
Post a comment