Skip to content

Instantly share code, notes, and snippets.

@jhchabran
Created September 2, 2009 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhchabran/179709 to your computer and use it in GitHub Desktop.
Save jhchabran/179709 to your computer and use it in GitHub Desktop.
# custom matchers to expect layouts
Spec::Matchers.define :use_layout do |layout|
match do |response|
response.layout == layout
end
failure_message_for_should do |employee|
"expected response to use layout named #{layout}"
end
failure_message_for_should_not do |employee|
"expected response to not use layout named #{layout}"
end
description do
"expected response to use layout named #{layout}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment