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: [...]
Posted in:
Coding
by
damon
/
Tags: fakeweb, rspec, ruby, testing
Comments Off
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: [...]
Posted in:
Coding
by
damon
/
Tags: fakeweb, ruby, testing
1 Comment
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 [...]
Posted in:
Coding
by
damon
/
Tags: css, haml, ruby, sass
4 Comments
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. [...]
Posted in:
Coding
by
damon
/
Tags: ruby, testing
Comments Off
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 [...]
Posted in:
Coding
by
damon
/
Tags: fakeweb, ruby, testing
Comments Off