<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dot.Using &#187; rails</title>
	<atom:link href="http://blog.kesor.net/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kesor.net</link>
	<description>Making technology about computers, and computers about usability.</description>
	<lastBuildDate>Mon, 29 Jun 2009 22:46:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Writing helpers with Haml and rSpec</title>
		<link>http://blog.kesor.net/2007/07/22/writing-helpers-with-haml-and-rspec/</link>
		<comments>http://blog.kesor.net/2007/07/22/writing-helpers-with-haml-and-rspec/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 19:02:46 +0000</pubDate>
		<dc:creator>kesor</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[specifications]]></category>

		<guid isPermaLink="false">http://blog.kesor.net/2007/07/22/writing-helpers-with-haml-and-rspec/</guid>
		<description><![CDATA[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 &#8211; what I did was :

[source:ruby]
Spec::Runner.configure do &#124;config&#124;
  config.with_options :behaviour_type => :helpers do &#124;config&#124;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Recently <a href="http://blog.wolfman.com/articles/2007/07/14/using-rspec-to-test-haml-helpers">Wolfman</a> posted a description about <a target="_blank" title="Ruby on Rails" href="http://www.rubyonrails.com">Rails</a> helpers written with <a target="_blank" title="HAML" href="http://haml.hamptoncatlin.com">Haml</a>::<a target="_blank" title="HAML::Helpers RDoc" href="http://haml.hamptoncatlin.com/docs/rdoc/classes/Haml/Helpers.html">Helpers#open</a> and <a target="_blank" title="rSpec" href="http://rspec.rubyforge.org">rSpec</a>.</p>
<p>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 <code>before(:each)</code></p>
<p>So basically &#8211; what I did was :</p>
<p><span id="more-8"></span><br />
[source:ruby]<br />
Spec::Runner.configure do |config|<br />
  config.with_options :behaviour_type => :helpers do |config|<br />
    config.include Haml::Helpers<br />
    config.include ActionView::Helpers<br />
    config.prepend_before :all do<br />
      @haml_is_haml = true<br />
      @haml_stack = [Haml::Buffer.new]<br />
    end<br />
  end<br />
end<br />
[/source]</p>
<p>Except it will not work, for various reasons.</p>
<p>Hope to solve all the quirks sometime soon. I know this will cost me some sleep.</p>
<p></p>

<div class="sociable">

<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.kesor.net%2F2007%2F07%2F22%2Fwriting-helpers-with-haml-and-rspec%2F&amp;title=Writing%20helpers%20with%20Haml%20and%20rSpec&amp;bodytext=Recently%20Wolfman%20posted%20a%20description%20about%20Rails%20helpers%20written%20with%20Haml%3A%3AHelpers%23open%20and%20rSpec.%0D%0A%0D%0AI%20want%20it%20to%20be%20more%20DRY%20than%20it%20is%2C%20since%20the%20whole%20application%20is%20using%20rSpec%20and%20Haml%2C%20all%20helpers%20should%20have%20the%20same%20before%28%3Aeach%29%0D%0A%0D%0ASo%20bas" title="Digg"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fblog.kesor.net%2F2007%2F07%2F22%2Fwriting-helpers-with-haml-and-rspec%2F&amp;title=Writing%20helpers%20with%20Haml%20and%20rSpec&amp;notes=Recently%20Wolfman%20posted%20a%20description%20about%20Rails%20helpers%20written%20with%20Haml%3A%3AHelpers%23open%20and%20rSpec.%0D%0A%0D%0AI%20want%20it%20to%20be%20more%20DRY%20than%20it%20is%2C%20since%20the%20whole%20application%20is%20using%20rSpec%20and%20Haml%2C%20all%20helpers%20should%20have%20the%20same%20before%28%3Aeach%29%0D%0A%0D%0ASo%20bas" title="del.icio.us"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fblog.kesor.net%2F2007%2F07%2F22%2Fwriting-helpers-with-haml-and-rspec%2F&amp;title=Writing%20helpers%20with%20Haml%20and%20rSpec" title="Reddit"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fblog.kesor.net%2F2007%2F07%2F22%2Fwriting-helpers-with-haml-and-rspec%2F" title="Technorati"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Writing%20helpers%20with%20Haml%20and%20rSpec&amp;body=http%3A%2F%2Fblog.kesor.net%2F2007%2F07%2F22%2Fwriting-helpers-with-haml-and-rspec%2F" title="email"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.kesor.net%2F2007%2F07%2F22%2Fwriting-helpers-with-haml-and-rspec%2F&amp;t=Writing%20helpers%20with%20Haml%20and%20rSpec" title="Facebook"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.kesor.net%2F2007%2F07%2F22%2Fwriting-helpers-with-haml-and-rspec%2F&amp;title=Writing%20helpers%20with%20Haml%20and%20rSpec&amp;annotation=Recently%20Wolfman%20posted%20a%20description%20about%20Rails%20helpers%20written%20with%20Haml%3A%3AHelpers%23open%20and%20rSpec.%0D%0A%0D%0AI%20want%20it%20to%20be%20more%20DRY%20than%20it%20is%2C%20since%20the%20whole%20application%20is%20using%20rSpec%20and%20Haml%2C%20all%20helpers%20should%20have%20the%20same%20before%28%3Aeach%29%0D%0A%0D%0ASo%20bas" title="Google Bookmarks"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="" title="Pownce"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/" title="Pownce" alt="Pownce" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="" title="TwitThis"><img src="http://blog.kesor.net/wp-content/plugins/sociable/images/" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.kesor.net/2007/07/22/writing-helpers-with-haml-and-rspec/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.241 seconds -->
