<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>DogBiscuit</title>
    <description>... mmm, crunchy!</description>
    <link>http://dogbiscuit.org/mdub/weblog</link>
    <language>en-us</language>
    <generator>EvenYetAnotherWeblog</generator>
    <item>
      <title>Introducing ShamRack</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/ShamRack</guid>
      <pubDate>Fri, 03 Jul 2009 15:50:00 +1000</pubDate>
      <description><![CDATA[<p>
The system I'm currently working on integrates with several external systems, over HTTP, using simple (RESTish) web-services.  I really don't want to involve those external systems while testing my own, though; I want to stub 'em out.
</p>
<p>
My first attempt involved stubbing out HTTP calls using my mocking framework of choice.  I'm using <a href='http://rest-client.heroku.com'>RestClient</a>, which I like a lot, and stubbing out RestClient API calls worked quite well.  It kept on working quite well for several hours, until I decided to refactor a little, using RestClient in a slightly differently way, at which point it broke completely.  Bother.  I really don't like having tests coupled to implementation details, so went searching for another way.
</p>
<p>
<a href='http://fakeweb.rubyforge.org'>FakeWeb</a> looked pretty good, in that it stubs things out at the Net::HTTP layer, which I'm unlikely to refactor out of the picture.  In the end, though, it's not really what I wanted. I wanted to be able to do things like:
</p>
<ul>
<li>
verify the body (and mime-type) of a POST/PUT request
</li>
<li>
dynamically generate responses, based on some aspect of the request (e.g. query parameters) 
</li>
</ul>
<p>
In short, I wanted a <a href='http://xunitpatterns.com/Fake%20Object.html'>Fake Object</a>, rather than a simple stub.
</p>
<p>
It occurred to me around about then that we already have plenty of tools for describing the behaviour of web-applications: they're called web-application frameworks!  Many of them are too heavy-weight for my purposes, but <a href='http://www.sinatrarb.com/'>Sinatra</a> is nicely minimal.  So, 60 lines of Ruby code later, I had a little web-app that mimicked one of those external web-services sufficiently for my testing.  Win!
</p>
<p>
But waitaminut.  I really don't want to have to start a separate process running my fake web-service, and talk to it using HTTP.  That's going to be slow: network I/O isn't cheap.  Isn't there some way I can use something like Sinatra but still keep everything in-process?
</p>
<p>
There is now.  <a href='http://github.com/mdub/sham_rack'>ShamRack</a> plumbs Net::HTTP directly into applications built to run on <a href='http://rack.rubyforge.org/'>Rack</a>.  Which includes all Sinatra apps, as well as Rails, Merb, etc.
</p>
<p>
<div align="center">
<img src="/mdub/images/ShamRack.png" />
</div>
</p>
<p>
Using ShamRack, I avoid the network traffic, making the tests a whole lot faster (about 25 times faster, in my case).  Plus, I avoid the complication of having to start and stop an external web-server.  Finally, because my fake web-service app is in-process, I get a handy back-channel I can use to setup or inspect it's state during tests.
</p>
<p>
If you find ShamRack handy, or have ideas about how it could improve, let me know!
</p>
]]></description>
    </item>
    <item>
      <title>Selenium Core 0.8.0</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/Selenium-0.8.0</guid>
      <pubDate>Fri, 29 Sep 2006 16:15:00 +1000</pubDate>
      <description><![CDATA[<p>
The <a href='http://www.openqa.org/selenium-core/'>Selenium Core</a> team (of which I'm
a sometime member)
<a href='http://wiki.openqa.org/display/SEL/2006/09/20/Selenium+Core+0.8.0+released'>released</a>
version 0.8.0 last week.
</p>
<p>
Highlights include:
<ul>
<li>
a "multiWindow" option which places the application-under-test in a
    separate window, allowing testing of "frame-busting" apps;
</li>
<li>
more reliable page-load detection for popup windows;
</li>
<li>
new cookie-management actions;
</li>
<li>
a run-speed slider and "Pause" button which replace the old Run/Walk/Step
    radio-buttons;
</li>
<li>
many bug-fixes and stability improvements;
</li>
<li>
tested against latest versions of Firefox, IE6, Opera, Konqueror, Safari
    and WebKit.
</li>
</ul>
</p>
<p>
The multi-window layout option is a great step forward, since it was a
limitation that prevented many people from using Selenium.
</p>
<p>
You can download the new version at:
<blockquote>
<a href='http://release.openqa.org/selenium-core/0.8.0/'>http://release.openqa.org/selenium-core/0.8.0/</a>
</blockquote>
</p>
<p>
(Yes, the documentation and website still suck.  Sorry.)
</p>
]]></description>
    </item>
    <item>
      <title>BasketCase</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/BasketCase</guid>
      <pubDate>Sun, 25 Jun 2006 00:00:00 +1000</pubDate>
      <description><![CDATA[<p>
The project I'm currently on uses <a href='http://www.ibm.com/software/awdtools/clearcase/'>Rational
ClearCase</a> to manage it's
source-code.
</p>
<p>
Now, I'm sure there are many great things about ClearCase.  Not that any
spring to mind.  (Wait, here's one: it keeps ClearCase administrators in a
job!  Whew, I knew there had to be a silver lining somewhere.)
</p>
<p>
What I can tell you, though, is that it <strong>sucks</strong> for agile, team
development.  So, I've wrapped a script around the ClearCase command-line,
to make the wannabe Subversion user in me feel more at home. 
</p>
<p>
(Ruby: <a href='http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/UnsetGlue.html'>the glue that doesn't
set</a>).
</p>
<p>
The result is <a href='http://basketcase.rubyforge.org'><strong>BasketCase</strong></a> (at
RubyForge).  It's still very much a work-in-progress (and when I no longer
have need of it, will likely become a work-in-abandonment), but I hope it
may provide a glimmer of hope to anyone else who finds themselves in a
similar predicament.
</p>
<p>
<small>
By the way, the less observant of you may not have noticed that the name is
a clever play on the word "rational".  Geddit?  Oh, nevermind ...
</small>
</p>
]]></description>
    </item>
    <item>
      <title>RSS Feed</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/Eyaw/RssFeed</guid>
      <pubDate>Wed, 09 Jun 2004 00:00:00 +1000</pubDate>
      <description><![CDATA[<p>
I finally got off my backside and added an <a href='http://dogbiscuit.org/mdub/weblog/?format=rss'>RSS
feed</a>.
</p>
]]></description>
    </item>
    <item>
      <title>QDox-1.4</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/QDox/20040501-qdox14</guid>
      <pubDate>Sat, 01 May 2004 00:00:00 +1000</pubDate>
      <description><![CDATA[<p>
<a href='http://qdox.codehaus.org/changes-report.html#1.4'>QDox-1.4</a> has been
released.  Go get it.
</p>
]]></description>
    </item>
    <item>
      <title>Looks crap in IE</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/Eyaw/20040112-crapInIE</guid>
      <pubDate>Mon, 12 Jan 2004 00:00:00 +1100</pubDate>
      <description><![CDATA[<p>
DogBiscuit looks crap in Internet Explorer.  Unbelievably, today is the
first time I've browsed this way with TheBorg's OneTrueBrowser (I'm
typically a Konqueror/Firebird user).  Under IE, the entry titles gradually
creep to the left! By about 2-pixels/entry, from what I can tell.  Weird.
Better do some CSS debugging.
</p>
<p>
Digging into it, it looks like I've hit the <a href='http://www.positioniseverything.net/explorer/creep.html'>Magik Creeping Text
bug</a>.  Removing the
border-left on the blog-entries fixed it.
</p>
<p>
Phew ... lucky no-one reads this stuff!
</p>
]]></description>
    </item>
    <item>
      <title>Dealing with Recategorisation</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/Eyaw/recategorisation</guid>
      <pubDate>Mon, 14 Apr 2003 13:54:00 +1000</pubDate>
      <description><![CDATA[<p>
A <a href='http://pragprog.com/pragdave/Tech/Blog/MoreWikiBlog.rdoc,v'>new feature in RubLog</a> 
allows "global" URIs for articles to be constructed using WikiWords.  Such
URIs use just the base-name of the article - not the whole category-path -
and so make links less likely to break if the category hierarchy is
re-organised.
</p>
<p>
PragDave makes a valid point: categorisation is kind of artificial and
arbitrary, and may be prone to change.  Actually, even with only a handful
of articles here on DogBiscuit, I've already been tempted to re-categorise
:-)
</p>
<p>
The RubLog feature works by allowing links using just the last part (the
"basename") of the article ID.  If the same basename is used in multiple
categories, this may result in collisions ...  RubLog solves the problem by
presenting all the matching articles.  One problem here is that the user
has no way of knowing which article is the "right one", ie. the intended
destination of the link.
</p>
<h2>
Categories as meta-data?
</h2>
<p>
Another approach might be to capture categories in article meta-data,
rather than using the file-system structure, e.g.
</p>
<pre>
    Subject: Dealing with Recategorisation
    Category: /Tech/Projects/Eyaw
    
    A new feature ...
</pre>
<p>
This way, articles can be filed into a directory structure that stays
fairly constant (e.g. directory per day?), and so can be used to form
"permanent" links.  Categories are laid "on top", and it could even allow
for an articles to be cross-filed in multiple categories.  Holy dueling
taxonomies!
</p>
<p>
On the downside, it becomes harder to <strong>see</strong> the category hierarchy, and
modifying it potentially involves editing a whole bunch of files.  Bother.
</p>
]]></description>
    </item>
    <item>
      <title>Even Yet Another WebLog</title>
      <guid>http://dogbiscuit.org/mdub/weblog/Tech/Projects/Eyaw/gettingStarted</guid>
      <pubDate>Sun, 13 Apr 2003 23:00:00 +1000</pubDate>
      <description><![CDATA[<p>
So, I'm messing around trying to craft a weblog CGI-script using Ruby.  I've
been very much influenced by <tt>blosxom</tt>, and by Dave Thomas's work on
<tt>RubLog</tt> ... but I needed a good excuse to play with Ruby, so have started
to hack together my own.
</p>
<p>
Basic features I'm after include:
</p>
<ul>
<li>
Wiki-esque markup
</li>
<li>
Easy hyperlinking
</li>
<li>
A simple, file-based data-store
</li>
<li>
Easy navigation
</li>
</ul>
<p>
But rather perversely, I'm not prepared to trust file <tt>mtimes</tt> to specify
posting dates.  Instead, I'm going to pull meta-information from the file
"header".  Sample input looks something like this:
</p>
<pre>
    Subject: entry title
    Date: 13 Apr 2003, 11pm

    Here's the content ...
</pre>
]]></description>
    </item>
  </channel>
</rss>
