Modulo failing test

Can you tell me why this fails the “uses Modulo operator” test?

def int_remainder_without_modulo(i_dividend, i_divisor)
  frac = (i_dividend.to_f / i_divisor.to_f)
  num = frac - dec_remainder_of_two_integers(i_dividend, i_divisor)
  i_num = num.to_i
  i_dividend - (i_divisor * num)

while this code passes?

def int_remainder_without_modulo(i_dividend, i_divisor)
d_remainder = dec_remainder_of_two_integers(i_dividend, i_divisor) # 0.6
f_remainder = d_remainder * i_divisor # 3.0 (0.6 * 5)

These is the test that the first code snippet fails (it passes the numerical tests, just not this one):

  describe "int_remainder_without_modulo" do
    # tests on sample numbers pass
    it "doesn't use the % operator" do
      a = double("Integer", :/ => 1, :to_f => 2.0)
      expect(a).not_to receive(:%)
      int_remainder_without_modulo(a, 2)

I think it’s because of the symbols you used. I asked a similar question here. Check out Kevin’s answer