SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    Stillwater, MN
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mocks as critics in Rails?

    The current mock functionality in Rails just seems to be server stubs, along with all of the other Ruby mock libraries I've seen. Am I missing something? Is there some reason that Ruby does not need to use mocks as critics?
    Rad Smith
    My blog

  2. #2
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    I haven't used any mock library in Ruby yet, but don't they allow passing of a block to their methods? You can throw an exception if the expectation is incorrect in the block perhaps? Which library were you looking at? Nat Pryce's original one or some of the derivations?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  3. #3
    killall -9 lusers
    Join Date
    Oct 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might want to check out Jim Weirich's FlexMock, if you haven't already. It has great support for acting as a critic.

    http://onestepback.org/software/flexmock/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •