I am using Steak to do acceptance testing because I didn’t like cucumber at all although I am using some cucumber concepts in the way I test. I liked the declarative vs imperative styles for testings and I am abstracting some expectations into elaborated custom rspec matchers that insinde the match method use other matchers, heres an example:
RSpec::Matchers.define :show_post do |post|
match do |page|
within '.post' do
page.should have_content post.title
page.should have_content post.tagline
page.should have_content post.body
page.should list_author post.author
end
end
end
The only problem I am having is that if my matcher fails I get a generic message that doesn’t give me any insight on what’s missing, when what I really want is to now which one of the expectation that compose the custom matcher is not meet.
I’ve been living with this nuisance for a while because I really like the expressiveness of being able to do:
page.should show_post Post.last
Better yet: