[Ironruby-core] Mocking behavior between clr types
me at miguelmadero.com
Tue Jan 26 22:50:51 EST 2010
TypeMock is doing thing slightly different that allows you to intercept
essentially calls to any member (static, sealed types, non-virtuals, etc).
It take sa different approach than Rhino and Moq, I'm not sure if something
similar could be done using Ruby, I'm just dropping the idea here....
On Mon, Jan 25, 2010 at 7:34 AM, Ivan Porto Carrero <ivan at flanders.co.nz>wrote:
> You don't need to do anything as drastic as disassemble dlls though :).
> There are several solutions and I think the cleanest one is to use the CLR
> profiling API. Another avenue I could take is to use Mono.Cecil but I don't
> like the idea of the IL rewriting stuff. heck even postsharp would probably
> do the trick.
> I need to look into the CLR profiling API to make the rest of the stuff
> happening as that is the cleanest solution IMO. The limitation only exists
> if you're mocking CLR classes for use in other CLR classes. If you're going
> to use it in ruby code you can do whatever you want.
> My mocker does most of what Moq and Rhino.Mocks do, except that it doesn't
> use LCG or expression trees but just the reflection API once per type. from
> there on out it uses ruby to do its job.
> What I need to add but don't know if they are really necessary are call
> count constraints.
> And I also want to make the RSpec integration a little bit better so that
> you can enlist an expectation for verification too.
> The docs are a bit outdated too, best is to look into
> spec/bacon/integration that's where I test out the new features or syntax
> I have a chapter in my book that explains the use of Caricature with RSpec
> which will be in the update at the end of january. Contact me off list if
> you want a discount :)
> Met vriendelijke groeten - Best regards - Salutations
> Ivan Porto Carrero
> Blog: http://flanders.co.nz
> Twitter: http://twitter.com/casualjim
> Author of IronRuby in Action (http://manning.com/carrero)
> On Sun, Jan 24, 2010 at 8:16 PM, andrew Wilson <a.wilson82 at gmail.com>wrote:
>> Seems like a what I was looking for, however according to the
>> documentation it says it can only mock virtuals and non-static though.
>> I don't want that restriction :( One of the advantages I was hoping to
>> leverage was the ability to re-write methods that I wouldn't otherwise be
>> able to.
>> When I wrote this, only God and I understood what I was doing. Now, God
>> only knows - Karl Weierstrass
>> Ironruby-core mailing list
>> Ironruby-core at rubyforge.org
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
Miguel A. Madero Reyes
me at miguelmadero.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironruby-core