ActiveResource, FakeWeb & Regex Mojo (authenticated edition)

Have a web service which needs requires authentication, but you’re testing a completely different part of the application?  Again, FakeWeb & Regex help you out here.  If you’re testing a model extended from ActiveResource by using FakeWeb, the url will look something like this:  1http://user:pass@example.com/someService To mock the request, use a regular expression like so: [...]

More FakeWeb & RegExp mojo (anchors edition)

I’ve been using a lot of FakeWeb + Rspec for creating ActiveResource models BDD-style without hitting my RESTful source.  I keep on figuring out little things with FakeWeb that I feel like I should share. When you register uri’s with FakeWeb, and you’re using regular expressions, you might be building layers of access like this: [...]

HAML/SASS and the Holy Grail

I’ve been using HAML and SASS a lot lately because it’s kind of the best thing since sliced bread and ZenCode.  I’ve also been using Mathew James Taylor‘s no-quirks-mode 3 column holy grail layout because: why re-invent the wheel (or in this case the Rube Goldberg Machine that is column layout in CSS). Matthew’s code [...]

MVC & BDD or “How I learned to stop worrying and love the test”

For a long time now, I’ve known I needed to get better at testing. Not smoke testing, but real unit testing, test driven development (TDD), or better yet behavior driven development (BDD).  I’d read papers, API’s and even wrote some after-the-fact unit tests for a CakePHP project.  It always seamed overly laborious and time consuming. [...]

RSpec, FakeWeb, Regexp; a gotcha

In my effort to be a better BDD/TDD (Behavior-Driven and Test-Driven Development) Developer, I’ve been diving into writing apps using RSpec for testing.  The nature of my work has me writing test where, in a non-automated-test environment, I would be using web services (SOAP and/or REST) to get and post data.  Now, obviously I don’t [...]