Unit Testing in Ruby | Cloudbees Blog
02-May-2023 488
In his article on Unit Testing, Martin Fowler mentions that what a unit actually is can change depending on what school of thought you come from. Many from the object-oriented world consider the Class as the unit, whereas those in the functional programming world consider the Function the unit.Even though Ruby is an object-oriented language, I tend to see the method/function as the unit. This is what should be tested, focusing on those methods which comprise the public interface of a particular class. Private methods can be tested through their public interfaces, allowing the actual implementation of them to change and be refactored as needed.
Unit Testing in Ruby | Cloudbees Blog #ruby #rubydeveloper #rubyonrails #Testing #Cloudbees #blog #cloudbees #testing https://rubyonrails.ba/link/unit-testing-in-ruby-cloudbees-blog