<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Jon's Blog</title>
  <id>http://127.0.0.1</id>
  <updated>2010-06-15T00:00:00Z</updated>
  <author>
    <name>Jon</name>
  </author>
  <entry>
    <title>Multiple Knife Environments</title>
    <link href="http://127.0.0.1/2010/07/12/multiple-knife-environments/" rel="alternate"/>
    <id>http://127.0.0.1/2010/07/12/multiple-knife-environments/</id>
    <published>2010-07-12T00:00:00Z</published>
    <updated>2010-07-12T00:00:00Z</updated>
    <author>
      <name>Jon</name>
    </author>
    <summary type="html">&lt;p&gt;At work we have two Chef environments, staging and production, so that we
don&amp;rsquo;t break our entire infrastructure because of a typo. Changes go to
staging, and once we know they work we push to production&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;At work we have two Chef environments, staging and production, so that we
don&amp;rsquo;t break our entire infrastructure because of a typo. Changes go to
staging, and once we know they work we push to production.&lt;/p&gt;

&lt;p&gt;To do that, I use a Knife config file that looks something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;CHEF_BASE = "/path/to/svn_root"
CHEF_ENV = ENV['CHEF_ENV'] || "staging"
case CHEF_ENV
  when 'staging'
    CHEF_SERVER = "https://chef.staging.example.org:443"
    CHEF_REPO = "#{CHEF_BASE}/trunk"
  when 'production'
    CHEF_SERVER = "https://chef.prod.example.org:443"
    CHEF_REPO = "#{CHEF_BASE}/branches/production"
end

client_key               "#{ENV['HOME']}/.chef/#{CHEF_ENV}.pem"
validation_key           "#{CHEF_REPO}/config/keys/#{CHEF_ENV}.pem"
chef_server_url          CHEF_SERVER
log_level                :info
log_location             STDOUT
node_name                `whoami`.chomp
validation_client_name   "chef-validator"
cache_type               'BasicFile'
cache_options( :path =&amp;gt; "#{ENV['HOME']}/.chef/checksums" )
cookbook_path            ["#{CHEF_REPO}/cookbooks", "#{CHEF_REPO}/site_cookbooks"]

knife({
  :rackspace_api_username =&amp;gt; "username",
  :rackspace_api_key  =&amp;gt; "api_key",
  :environment =&amp;gt; CHEF_ENV
})
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Using that, by default any knife command I run will go to the staging server, but if
do this: &lt;code&gt;CHEF_ENV=production knife cookbook upload -a&lt;/code&gt; then it will go to the production
server instead.&lt;/p&gt;

&lt;p&gt;This does depend on some conventions we have in place in our Chef repository. As you can
see, we keep validation keys in SVN, and each user&amp;rsquo;s client is named after their user login.&lt;/p&gt;

&lt;h1&gt;Footnote&lt;/h1&gt;

&lt;p&gt;How do we know they work? Nagios, which under the staging environment is effectively used
as a test suite &amp;ndash; if everything stays green, then it&amp;rsquo;s considered to be working.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Starting a Testable Sinatra Application</title>
    <link href="http://127.0.0.1/2010/07/04/starting-a-testable-sinatra-application/" rel="alternate"/>
    <id>http://127.0.0.1/2010/07/04/starting-a-testable-sinatra-application/</id>
    <published>2010-07-04T00:00:00Z</published>
    <updated>2010-07-04T00:00:00Z</updated>
    <author>
      <name>Jon</name>
    </author>
    <summary type="html">&lt;p&gt;I&amp;rsquo;m getting into using Sinatra for smaller web applications, instead of the behemoth that is Rails.&lt;/p&gt;

&lt;p&gt;For many purposes, Rails is still perfect, but I often find that it can be overkill if all you need
is to display a couple of pages, and possibly provide an API. Here&amp;rsquo;s a quick guide on creating a
Sinatra application that can be tested using RSpec and Cucumber&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I&amp;rsquo;m getting into using Sinatra for smaller web applications, instead of the behemoth that is Rails.&lt;/p&gt;

&lt;p&gt;For many purposes, Rails is still perfect, but I often find that it can be overkill if all you need
is to display a couple of pages, and possibly provide an API. Here&amp;rsquo;s a quick guide on creating a
Sinatra application that can be tested using RSpec and Cucumber.&lt;/p&gt;

&lt;h2&gt;Install Bundler, and Create a Gemfile&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://gembundler.com"&gt;Bundler&lt;/a&gt; lets us manage the list of gems that our application depends on. I&amp;rsquo;m
using it on all new projects now, so that I don&amp;rsquo;t have to spend half an hour remembering what needs to
be installed before starting.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem install bundler
cd /path/to/example_app
bundle init
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That will create &lt;code&gt;Gemfile&lt;/code&gt; in the example application&amp;rsquo;s root directory, which we can use to specify the
gems our application needs. Put the following in it for now:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;source :gemcutter

gem "sinatra"
gem "unicorn"
gem "haml"

group :test do
  gem "cucumber-sinatra"
  gem "cucumber"
  gem "capybara"
  gem "rspec"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now when you run &lt;code&gt;bundle install&lt;/code&gt; it&amp;rsquo;ll install any dependencies that are required.&lt;/p&gt;

&lt;h2&gt;Create a Stub Application&lt;/h2&gt;

&lt;p&gt;This is going to be a really simple stub application for now, since this article isn&amp;rsquo;t really trying to
teach you how to use Sinatra.&lt;/p&gt;

&lt;p&gt;Put the following in &lt;code&gt;lib/application.rb&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'sinatra/base'
require 'haml'

class Application &amp;lt; Sinatra::Base
  set :app_file, __FILE__
  set :inline_templates, true

  get '/' do
    haml :index
  end
end

__END__
@@ index
!!!
%html
  %head
    %title A test application
  %body
    %h1 Hello, world!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Just to check that it&amp;rsquo;s all working, dump this in &lt;code&gt;config.ru&lt;/code&gt;, which will load everything using
Bundler.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$: &amp;lt;&amp;lt; "lib"

require 'application'
run Application
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And run it with &lt;code&gt;bundle exec unicorn&lt;/code&gt; &amp;ndash; loading &lt;code&gt;bundle exec&lt;/code&gt; ensures all the gems specified have been
loaded from the appropriate location before running the application itself.&lt;/p&gt;

&lt;h2&gt;Add a Slice of Cucumber&lt;/h2&gt;

&lt;p&gt;Now we&amp;rsquo;re going to make this testable with Cucumber:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bundle exec cucumber-sinatra init Application lib/application.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That will tell you about the files it&amp;rsquo;s generating. Lets have a look at &lt;code&gt;features/support/env.rb&lt;/code&gt; which
is where Cucumber gets configured. You&amp;rsquo;ll see that it simply loads &lt;code&gt;application.rb&lt;/code&gt; and then tells
Capybara (the component that actually runs web apps) that the application under test is &lt;code&gt;Application&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Lets write a feature to test that our simple application is in fact working. Put this in
&lt;code&gt;features/hello.feature&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Feature: Welcoming new developers
As a software developer
I want the world to be welcomed
So I get a fuzzy feeling of success

Scenario: Loading the welcome page
  When I go to the home page
  Then I should see "Hello, world!"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When you run it with &lt;code&gt;bundle exec features/hello.feature&lt;/code&gt; it should pass.&lt;/p&gt;

&lt;h2&gt;Cucumber Profiles&lt;/h2&gt;

&lt;p&gt;By using profiles we can make use of the WIP (Work in Progress) tag to reduce the time it takes to run
our features when we&amp;rsquo;re only interested in one or two features.&lt;/p&gt;

&lt;p&gt;Start by creating &lt;code&gt;cucumber.yml&lt;/code&gt; and put the following in it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;% common = "--strict features" %&amp;gt;
default: --format progress &amp;lt;%= common %&amp;gt;
wip: --format pretty --tags @wip &amp;lt;%= common %&amp;gt;
ok: --format pretty --tags ~@wip &amp;lt;%= common %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will provide you with three profiles, &lt;code&gt;default&lt;/code&gt;, &lt;code&gt;wip&lt;/code&gt;, and &lt;code&gt;ok&lt;/code&gt; for different tasks. &lt;code&gt;default&lt;/code&gt; will
run all features, in progress mode &amp;ndash; this is probably the one you want to use for continuous integration.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wip&lt;/code&gt; and &lt;code&gt;ok&lt;/code&gt; are opposites, with &lt;code&gt;wip&lt;/code&gt; running anything with the &lt;code&gt;@wip&lt;/code&gt; tag applied, and &lt;code&gt;ok&lt;/code&gt; doing
the opposite.&lt;/p&gt;

&lt;p&gt;Now lets create some rake tasks to run them &amp;ndash; put this in &lt;code&gt;Rakefile&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'cucumber'
require 'cucumber/rake/task'

namespace :features do
  Cucumber::Rake::Task.new(:all) do |t|
    t.profile = "default"
  end

  Cucumber::Rake::Task.new(:ok) do |t|
    t.profile = "ok"
  end

  Cucumber::Rake::Task.new(:all) do |t|
    t.profile = "wip"
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now when you run the rake tasks you&amp;rsquo;ll get the appropriate features run.&lt;/p&gt;

&lt;h2&gt;And now for some RSpec&lt;/h2&gt;

&lt;p&gt;Finally, we&amp;rsquo;re going to set up RSpec. This probably won&amp;rsquo;t be at all unusual to you if you&amp;rsquo;ve done it
before, but I&amp;rsquo;m going to demonstrate it as well.&lt;/p&gt;

&lt;p&gt;In your Rakefile:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'spec/rake/spectask'

namespace :spec do
  desc "Run all examples"
  Spec::Rake::SpecTask.new('spec') do |t|
    t.spec_files = FileList['spec/**/*_spec.rb']
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then put this in &lt;code&gt;spec/spec_helper.rb&lt;/code&gt; to make sure anything in lib/ can be loaded correctly:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$: &amp;lt;&amp;lt; File.expand_path(File.dirname(__FILE__) + '/../lib')
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that&amp;rsquo;s about it. Create a &lt;code&gt;spec&lt;/code&gt; directory, and start filling it up with specs ending in &lt;code&gt;_spec.rb&lt;/code&gt;,
like this one (in &lt;code&gt;spec/application_spec.rb&lt;/code&gt;):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'application'

describe Application do
  it { should_not be_nil }
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now when you run &lt;code&gt;rake spec:all&lt;/code&gt; if all went well you&amp;rsquo;ll see a passing spec.&lt;/p&gt;

&lt;h2&gt;On With the Code&lt;/h2&gt;

&lt;p&gt;That&amp;rsquo;s as far as I&amp;rsquo;m going to go with this for now. Go write some code.&lt;/p&gt;

&lt;p&gt;You can find the end result of this in the &lt;a href="http://github.com/jellybob/sinatra-example"&gt;sinatra-example&lt;/a&gt;
project under my &lt;a href="http://github.com/jellybob/"&gt;GitHub account&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Installing an Ubuntu 10.04 Server Under VirtualBox</title>
    <link href="http://127.0.0.1/2010/06/22/installing-an-ubuntu-1004-server-under-virtualbox/" rel="alternate"/>
    <id>http://127.0.0.1/2010/06/22/installing-an-ubuntu-1004-server-under-virtualbox/</id>
    <published>2010-06-22T00:00:00Z</published>
    <updated>2010-06-22T00:00:00Z</updated>
    <author>
      <name>Jon</name>
    </author>
    <summary type="html">&lt;p&gt;When installing Ubuntu 10.04 Server as a VirtualBox VM, don&amp;rsquo;t use the
&amp;ldquo;Install Minimal Virtual Machine&amp;rdquo; option in the installer options.&lt;/p&gt;

&lt;p&gt;Strangely, that causes installing it as a VM to fail spectacularly, with&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;When installing Ubuntu 10.04 Server as a VirtualBox VM, don&amp;rsquo;t use the
&amp;ldquo;Install Minimal Virtual Machine&amp;rdquo; option in the installer options.&lt;/p&gt;

&lt;p&gt;Strangely, that causes installing it as a VM to fail spectacularly, with
the boot loader failing to find any hard disks. A standard install seems
to work fine.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Creating a new Rails 3 Application with Mongoid, RSpec,  Cucumber and Shoulda</title>
    <link href="http://127.0.0.1/2010/06/16/creating-a-new-rails-3-application-with-mongoid-rspec-cucumber-and-shoulda/" rel="alternate"/>
    <id>http://127.0.0.1/2010/06/16/creating-a-new-rails-3-application-with-mongoid-rspec-cucumber-and-shoulda/</id>
    <published>2010-06-16T00:00:00Z</published>
    <updated>2010-06-16T00:00:00Z</updated>
    <author>
      <name>Jon</name>
    </author>
    <summary type="html">&lt;p&gt;This article will work through creating a new Rails 3 application ready to start
building a site using &lt;a href="" title="http://mongoid.org/"&gt;Mongoid&lt;/a&gt;, and testing it with
&lt;a href="" title="http://cukes.info"&gt;Cucumber&lt;/a&gt; and &lt;a href="" title="http://rspec.info"&gt;RSpec&lt;/a&gt;&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;This article will work through creating a new Rails 3 application ready to start
building a site using &lt;a href="" title="http://mongoid.org/"&gt;Mongoid&lt;/a&gt;, and testing it with
&lt;a href="" title="http://cukes.info"&gt;Cucumber&lt;/a&gt; and &lt;a href="" title="http://rspec.info"&gt;RSpec&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m going to assume you&amp;rsquo;re familiar with the basics, and you&amp;rsquo;ve got a copy of
Ruby 1.8.7 and MongoDB installed and running. If that&amp;rsquo;s not the case, go and
get it setup using &lt;a href="" title="http://rvm.beginrescueend.com/"&gt;RVM&lt;/a&gt; or similar.&lt;/p&gt;

&lt;p&gt;As much as I&amp;rsquo;d love to be using Ruby 1.9.2, ruby-debug doesn&amp;rsquo;t work with it yet,
and I&amp;rsquo;m not about to give up my precious debugger.&lt;/p&gt;

&lt;h2&gt;Creating the Application&lt;/h2&gt;

&lt;p&gt;You&amp;rsquo;ll need to install the pre-release version (currently 3.0.0 beta 4) before
we start:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# gem install rails --version "3.0.0.beta4"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once that&amp;rsquo;s done, you can create a new application. We&amp;rsquo;re going to skip some of
the default components, because we&amp;rsquo;ll be using alternatives.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# rails new example_app --skip-activerecord \
                        --skip-prototype \
                        --skip-testunit
create  
create  README
create  Rakefile
create  config.ru
... lots more create statements ...
create  tmp/pids
create  vendor/plugins
create  vendor/plugins/.gitkeep
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Install the Gems&lt;/h2&gt;

&lt;p&gt;Once our application has been generated we need to specify the gems we&amp;rsquo;ll be
using in the Gemfile, which is used by &lt;a href="" title="http://gembundler.com/"&gt;Bundler&lt;/a&gt; to
manage dependencies.&lt;/p&gt;

&lt;p&gt;In your application root, open up &lt;code&gt;Gemfile&lt;/code&gt; and replace it with
the following, which should be fairly self explanatory.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;source "http://rubygems.org"

gem 'rails', '3.0.0.beta4'
gem 'mongoid', :git =&amp;gt; 'git://github.com/durran/mongoid.git'
# C extension to improve MongoDB performance
gem 'bson_ext'

group :development do
  gem 'unicorn'
  gem 'ruby-debug'
end

group :test do
  gem 'capybara'
  gem 'cucumber-rails'
  gem 'rspec-rails', '&amp;gt;= 2.0.0.beta.12'
  gem 'factory_girl'
  gem 'mongoid-rspec', :require =&amp;gt; false
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And then run &lt;code&gt;bundle install&lt;/code&gt; to install all the dependencies.&lt;/p&gt;

&lt;h2&gt;Install Mongoid&lt;/h2&gt;

&lt;p&gt;The next few steps are mostly just running generators, thanks to the fancy new
integration available with Rails 3.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# rails g mongoid:config
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then open up &lt;code&gt;config/mongoid.yml&lt;/code&gt; and make any changes neccesary for
your machine. The defaults work for me when using a copy of Mongo installed using
&lt;a href="" title="http://mxcl.github.com/homebrew/"&gt;Homebrew&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At this point, when you generate a new model, you&amp;rsquo;ll get a Mongoid document rather
then an ActiveRecord model.&lt;/p&gt;

&lt;h2&gt;Install RSpec&lt;/h2&gt;

&lt;p&gt;Installing RSpec is very similar:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# rails g rspec:install
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then insert the following after &lt;code&gt;require &amp;lsquo;rspec/rails&amp;rsquo;&lt;/code&gt; in
&lt;code&gt;spec/spec_helper.rb&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'mongoid-rspec'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And this after the &lt;code&gt;Rspec.configure&lt;/code&gt; line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;include Mongoid::Matchers
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That&amp;rsquo;s it for vanilla RSpec. Nothing more to be done. If you run &lt;code&gt;rake&lt;/code&gt;
now you should see.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(in /Users/jon/Dropbox/example_app)
No examples matching ./spec/**/*_spec.rb could be found
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Install Cucumber&lt;/h2&gt;

&lt;p&gt;We&amp;rsquo;re going to install Cucumber telling it to use Capybara so that we can test
Javascript as well, and not to modify database.yml&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rails g cucumber:install --capybara --skip-database
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We&amp;rsquo;ll also need to provide it with a placeholder task for db:test:prepare,
because it expects that to be present as well. If it&amp;rsquo;s not their, you&amp;rsquo;ll get the
error &lt;code&gt;Don&amp;rsquo;t know how to build task &amp;lsquo;db:test:prepare&amp;rsquo;&lt;/code&gt;.
Put the following in &lt;code&gt;lib/tasks/db.rake&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;namespace :db do
  namespace :test do
    task :prepare do
      # Placeholder for Cucumber
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And the Cucumber environment needs changing to deal with ActiveRecord not being
present as well. Edit &lt;code&gt;features/support/env.rb&lt;/code&gt; and comment out or
remove the line below.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Cucumber::Rails::World.use_transactional_fixtures = true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;While you&amp;rsquo;re in there, remove the if statement around Database Cleaner&amp;rsquo;s setup
so that the database is also emptied out for MongoDB.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# if defined?(ActiveRecord::Base)
  begin
    require 'database_cleaner'
    DatabaseCleaner.strategy = :truncation
  rescue LoadError =&amp;gt; ignore_if_database_cleaner_not_present
  end
# end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now that all that has been done, you should be able to run
&lt;code&gt;rake cucumber:ok&lt;/code&gt; and get this output:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Using the default profile...


0 scenarios
0 steps
0m0.000s
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Testing Sugar&lt;/h2&gt;

&lt;p&gt;Now we&amp;rsquo;re going to add in Factory Girl to the test suite to make things
that little bit more conveniant for us. It even comes with Cucumber steps
to build models from factories.&lt;/p&gt;

&lt;p&gt;Create a directory for factories. We&amp;rsquo;ll eventually fill this with a file for
each model type, in the format &lt;code&gt;model_name_factories.rb&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# mkdir spec/factories
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And then require factory_girl and the factories for both RSpec and Cucumber.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;spec/spec_helper.rb&lt;/code&gt;, after you require mongoid-rspec&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'factory_girl'
Dir.glob(Rails.root.join("spec", "factories", "*.rb").to_s).each do |f|
  require f
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And in &lt;code&gt;features/support/env.rb&lt;/code&gt;, after Capybara configuration the
same, followed by:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require 'factory_girl/step_definitions'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Check out &lt;a href="" title="http://robots.thoughtbot.com/post/284805810/gimme-three-steps"&gt;Thoughtbot&amp;rsquo;s article&lt;/a&gt;
on the bundled Cucumber steps.&lt;/p&gt;

&lt;h2&gt;Bonus! jQuery&lt;/h2&gt;

&lt;p&gt;You may have noticed my call to &amp;mdash;skip-prototype. That&amp;rsquo;s because we&amp;rsquo;re going to
use jQuery instead.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;curl http://github.com/rails/jquery-ujs/raw/master/src/rails.js &amp;gt; public/javascripts/rails.js
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And then when you load jQuery, load rails.js as well, and you can use the standard
Rails helpers for Javascript and it&amp;rsquo;ll all just work.&lt;/p&gt;

&lt;h2&gt;And Your Done&lt;/h2&gt;

&lt;p&gt;Thats it. You&amp;rsquo;re ready to rock and roll now.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>A Blog, You Say?</title>
    <link href="http://127.0.0.1/2010/06/15/a-blog-you-say/" rel="alternate"/>
    <id>http://127.0.0.1/2010/06/15/a-blog-you-say/</id>
    <published>2010-06-15T00:00:00Z</published>
    <updated>2010-06-15T00:00:00Z</updated>
    <author>
      <name>Jon</name>
    </author>
    <summary type="html">&lt;p&gt;Yes, a blog! I&amp;rsquo;m once again going to try writing regularly. Whether or not
this descends into the usual deriliction of previous attempts we&amp;rsquo;ll have to
see, but I&amp;rsquo;m hopeful&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Yes, a blog! I&amp;rsquo;m once again going to try writing regularly. Whether or not
this descends into the usual deriliction of previous attempts we&amp;rsquo;ll have to
see, but I&amp;rsquo;m hopeful.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m using a nice simple tool, in the shape of
&lt;a href="http://github.com/cloudhead/toto"&gt;Toto&lt;/a&gt; which is a very minimalist blogging
engine, in the hope that using nothing but plain text will help me to focus
more on writing, and less on endlessly tweaking things.&lt;/p&gt;

&lt;p&gt;Topics to be covered include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Software development, particularly using Ruby&lt;/li&gt;
&lt;li&gt;Systems administration, focusing on automated infrastructures&lt;/li&gt;
&lt;li&gt;Games&lt;/li&gt;
&lt;li&gt;Cooking&lt;/li&gt;
&lt;li&gt;And a bit of everything else for good measure&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
</feed>
