Writing helpers with Haml and rSpec
Recently Wolfman posted a description about Rails helpers written with Haml::Helpers#open and rSpec.
I want it to be more DRY than it is, since the whole application is using rSpec and Haml, all helpers should have the same before(:each)
So basically – what I did was :
[source:ruby]
Spec::Runner.configure do |config|
config.with_options :behaviour_type => :helpers do |config|
config.include Haml::Helpers
config.include ActionView::Helpers
config.prepend_before :all do
@haml_is_haml = true
@haml_stack = [Haml::Buffer.new]
end
end
end
[/source]
Except it will not work, for various reasons.
Hope to solve all the quirks sometime soon. I know this will cost me some sleep.
1 Comment