Como afirmar que determinado método é chamado com o framework minitest do Ruby?
Eu quero testar se uma função invoca outras funções corretamente com minitest Ruby, mas não consigo encontrar um bomassert
para testar a partir dodoc.
class SomeClass
def invoke_function(name)
name == "right" ? right () : wrong ()
end
def right
#...
end
def wrong
#...
end
end
O código de teste:describe SomeClass do
it "should invoke right function" do
# assert right() is called
end
it "should invoke other function" do
# assert wrong() is called
end
end