Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created March 12, 2010 19:25
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 myronmarston/330665 to your computer and use it in GitHub Desktop.
Save myronmarston/330665 to your computer and use it in GitHub Desktop.
# The idea for this technique taken from: http://blog.wolfman.com/articles/2007/07/14/using-rspec-to-test-haml-helpers
module HelperHamlSupport
def new(*args, &block)
super.tap do |obj|
obj.extend Haml
obj.extend Haml::Helpers
obj.init_haml_helpers
end
end
end
Spec::Rails::Example::HelperExampleGroup::HelperObject.extend HelperHamlSupport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment