Skip to content

Instantly share code, notes, and snippets.

@heim
Created June 9, 2009 20:52
Show Gist options
  • Save heim/126776 to your computer and use it in GitHub Desktop.
Save heim/126776 to your computer and use it in GitHub Desktop.
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
load RAILS_ROOT + '/lib/tasks/populate.rake'
Given /^I have an empty (.+) table$/ do |table_name|
Kernel.const_get(table_name.singularize.camelize).destroy_all
end
When /^I run "rake ([^\"]*)"$/ do |task|
Rake::Task[task].invoke.should be_true
end
Then /^the database should contain one or more posts$/ do
Post.all.size.should > 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment