15MayAn update on caricature

Yesterday I explained about caricature but I didn’t have it fully tested yet. Today I’ve written a bunch of integration specs for all the platform combinations Caricature currently supports so you should be able to use Caricature also for plain ruby object mocking in addition to CLR interop mocking.

After having a very brief twitter discussion with Scott I decided it would be a good idea to change the name of the methods when\_told\_to and was\_told\_to? . In ruby objects receive messages so the wording now becomes when\_receiving and did\_receive? . I have a problem with the should naming because there is nothing conditional about it. Either you want the method to return something or you want it to return a default value for CLR value types or nil.  And if you’re asserting if a method it called that is deterministic; it is either called or not there is no gray area there.


ninja = ClrModels::Ninja.new 

@weapon.when_receiving(:attack).with(ninja).return(5) 

@ninja.attack(ninja, @weapon).should.equal 5 

@weapon.did_receive?(:attack).with(:any).should.be.successful 

Before I call it 1.0 I want to at least give ruby objects also the ability to isolate static and sealed methods as well as mocking ruby class methods.  So that for CLR to Ruby interaction you a get the full range of possibilities.

I have also set up a site on github that contains the API documentation for Caricature. When IronRuby 0.5 releases I’ll publish a blog post that will talk you through testing your CLR assembly with IronRuby, bacon and Caricature.

For now you can take a look here for example on how to use Caricature for isolating features.


  1. 1 verborghs19 May 2009

    Hi Ivan,

    After seeing you demo on silverline at arrrrcamp I just had to try it out on moonlight. It does seem to work after initial trails on the newly released version. Thanks for the hint.


Recent Flickrs

    Blogroll

    Recent Listening

    Scrobbler
    • Loading...