dot.Using Making technology about computers, and computers about usability.

Posted
22 July 2007 @ 9pm

Tagged
development, haml, ideas, rails, rspec, ruby, specifications

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.

  • Digg
  • del.icio.us
  • Reddit
  • Technorati
  • email
  • Facebook
  • Google Bookmarks
  • Pownce
  • TwitThis

1 Comment

Posted by
Yitzhak Bar Geva
21 November 2007 @ 11am

Did you ever solve the problems with writing helpers and rspec?
BTW, where do you work? Can you e-mail me?


Leave a Comment

Using FireBug’s console logger with GreaseMonkey 0.6.4 HAML Caching CGI