I've tried Random.stub :rand, 1 do ... end
and Kernel.stub :rand, 1 do ... end
and Class.stub :rand, 1 do ... end
(because when I run self.class
where I run rand I get Class
). I've also tried replacing rand(2)
with Random.rand(2)
but it doesn't help.
So how do I stub out rand?
Aucun commentaire:
Enregistrer un commentaire