Given /^a missing impartial controller named "([^"]*)"$/ do |name| @missing = name end When /^I try to render the impartial$/ do # noop end Then /^I should get a class not found exception$/ do lambda { Impartial.render(@missing) }.should raise_error Impartial::Exceptions::ClassNotFound end Given /^it's missing it's template$/ do # noop end Then /^I should get a template missing exception$/ do lambda { Impartial.render(@missing) }.should raise_error Impartial::Exceptions::TemplateMissing end