![]() ![]() If you are an RSpec user the way to accomplish these is to use allow in combination with an instance_double or class_double.Ĭool_class.rb class CoolClass def self.foo 'bar' end endĬool_class_spec.rb require 'rspec' RSpec. By mocking out side effects we are able to test the interface of a single unit (method/worker/service etc.) and ensure that many edge cases can run quickly and consistently. Boundaries need to be drawn in order to accentuate each layer of your testing pyramid. Any system under test needs some degree of mocks.
0 Comments
Leave a Reply. |