Created
March 12, 2010 19:25
-
-
Save myronmarston/330665 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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