Hi everybody,

I run into an issue with the "class" method of a mocked model. The following
expectation fails:

@user = mock_model(Author)
is_author(user).should == true

def is_author(user)
  case user
    when Author
      return true
  else
    return false
  end
end

However, it works well when running the app. I guess that the problem comes
from the mock as it compares the mocked-model.class with the
real-model.class. Do you have any idea to fix that?

For now, I use "Author.class.to_s" but I don't like to make my code ugly for
the mock to work. :)

Cheers,

φ
http://pcreux.com
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to