Archive of Testing

FakeWeb

Posted by Kevin McKelvin on September 20, 2011 in Ruby, Testing

I was testing a client I wrote to a server API recently.  Being relatively new to testing with RSpec and Ruby, I initially took the naive approach of building a node.js application to behave as a dummy test server.Originally when I wrote the code I knew there had to be a better way, but I only found that better way today.I was revisiting some of that code and discovered FakeWeb.  It's a Ruby framework that makes it simple to test code that involves HTTP requests.  It intercepts HTTP calls made through Net::HTTP and makes it dead simple to create predictable responses for

Continue ReadingLeave a Comment

Getting Started with TypeMock Isolator (in VS2010)

Posted by Kevin McKelvin on June 14, 2011 in Testing

I started playing with TypeMock Isolator this morning as an alternative to using the Moles framework from Microsoft Research. Isolation frameworks allow you to intercept and redirect calls made to concrete call sites and replace them with a delegate.  If that sounds like a bit of gibberish consider this scenario: If you have a class that makes a call to DateTime.Now to check against an expiry date and you want to test that it expires on a future date, you need to control what the static DateTime.Now returns.  That’s where an isolator comes in. To get started with TypeMock, once

Continue ReadingView Comments (2)