<?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>One Man's Walk in work &#187; rspec</title>
	<atom:link href="http://onemanswalk.com/work/tag/rspec/feed/" rel="self" type="application/rss+xml" />
	<link>http://onemanswalk.com/work</link>
	<description>jeremy lightsmith on agile, ruby, and consulting</description>
	<lastBuildDate>Fri, 23 Jul 2010 22:43:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stop running test:unit tests when using rspec</title>
		<link>http://onemanswalk.com/work/2009/01/16/stop-running-testunit-tests-when-using-rspec/</link>
		<comments>http://onemanswalk.com/work/2009/01/16/stop-running-testunit-tests-when-using-rspec/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 17:53:43 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://onemanswalk.com/work/?p=67</guid>
		<description><![CDATA[	You know those 3 lines that show up every time you do an rspec run?

	
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -Ilib:test &#34;/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb&#34;  
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -Ilib:test &#34;/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb&#34;  
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -Ilib:test &#34;/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb&#34;




	&#8230;yeah, those lines.  I hate those lines.

	So let&#8217;s get rid of them!

	Each of those lines is rails trying to run test:unit.  RSpec replaces the default rake target by doing [...]]]></description>
			<content:encoded><![CDATA[	<p>You know those 3 lines that show up every time you do an rspec run?</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="dos">/System/Library/Frameworks/Ruby.framework/Versions/<span style="color: #cc66cc;">1.8</span>/usr/bin/ruby -Ilib:test &quot;/Library/Ruby/Gems/<span style="color: #cc66cc;">1.8</span>/gems/rake<span style="color: #cc66cc;">-0.8</span><span style="color: #cc66cc;">.3</span>/lib/rake/rake_test_loader.rb&quot;  
/System/Library/Frameworks/Ruby.framework/Versions/<span style="color: #cc66cc;">1.8</span>/usr/bin/ruby -Ilib:test &quot;/Library/Ruby/Gems/<span style="color: #cc66cc;">1.8</span>/gems/rake<span style="color: #cc66cc;">-0.8</span><span style="color: #cc66cc;">.3</span>/lib/rake/rake_test_loader.rb&quot;  
/System/Library/Frameworks/Ruby.framework/Versions/<span style="color: #cc66cc;">1.8</span>/usr/bin/ruby -Ilib:test &quot;/Library/Ruby/Gems/<span style="color: #cc66cc;">1.8</span>/gems/rake<span style="color: #cc66cc;">-0.8</span><span style="color: #cc66cc;">.3</span>/lib/rake/rake_test_loader.rb&quot;</pre></div></div>
</p>



	<p>&#8230;yeah, those lines.  I hate those lines.</p>

	<p>So let&#8217;s get rid of them!</p>

	<p>Each of those lines is rails trying to run test:unit.  RSpec replaces the default rake target by doing this:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">task <span style="color:#ff3333; font-weight:bold;">:default</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:spec</span></pre></div></div>
</p>



	<p><span class="caps">BUT</span><img src="!" alt="" border="0" />  If you&#8217;ve played with rake before, you know that this doesn&#8217;t actually replace the default target, it only adds to it.  We need to remove the default target <em>then</em> point it at :spec</p>

	<p>Turns out that&#8217;s not too hard.  Put this code (got it from <a href="http://rubyizednrailified.blogspot.com/2008/07/remove-rake-tasks.html" title="">here</a>) at the end of your Rakefile:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#6666ff; font-weight:bold;">Rake::TaskManager</span>.<span style="color:#9900CC;">class_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> remove_task<span style="color:#006600; font-weight:bold;">&#40;</span>task_name<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@tasks</span>.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span>task_name.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
Rake.<span style="color:#9900CC;">application</span>.<span style="color:#9900CC;">remove_task</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;default&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
task <span style="color:#ff3333; font-weight:bold;">:default</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:spec</span></pre></div></div>
</p>



	<p>You&#8217;re all set!</p>
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2009/01/16/stop-running-testunit-tests-when-using-rspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
