<?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/"
	>

<channel>
	<title>David Chelimsky</title>
	<atom:link href="http://blog.davidchelimsky.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.davidchelimsky.net</link>
	<description></description>
	<pubDate>Fri, 30 Jul 2010 02:28:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The RSpec Book has entered the production process!</title>
		<link>http://blog.davidchelimsky.net/2010/07/30/the-rspec-book-has-entered-the-production-process/</link>
		<comments>http://blog.davidchelimsky.net/2010/07/30/the-rspec-book-has-entered-the-production-process/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 02:28:18 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[BDD]]></category>

		<category><![CDATA[RSpec]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[The RSpec Book]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2668</guid>
		<description><![CDATA[I&#8217;m thrilled to announce that The RSpec Book has entered the production process!

For those of you unfamiliar with the publishing industry, as I was before this project, &#8220;has entered the production process&#8221; does not mean that it&#8217;s off to the printer. What it does mean is that it is currently being indexed so readers will [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m thrilled to announce that <a href="http://pragprog.com/titles/achbd/the-rspec-book">The RSpec Book</a> has entered the production process!</p>

<p>For those of you unfamiliar with the publishing industry, as I was before this project, &#8220;has entered the production process&#8221; does <em>not</em> mean that it&#8217;s off to the printer. What it <em>does</em> mean is that it is currently being indexed so readers will be able to find the stuff they&#8217;re looking for. After indexing it will be copyedited (in which someone with better grammar and spelling than any of the authors possess makes the book more readable) and typeset, and <em>then</em> off to the printer.</p>

<p>If all goes to plan (yes, there actually is a plan!), <code>books.should be&#95;on&#95;shelves</code> in late September, early October.</p>

<p>That light at the end of the tunnel is, finally, <em>not</em> an oncoming train!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/07/30/the-rspec-book-has-entered-the-production-process/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The RSpec Book - Beta 14</title>
		<link>http://blog.davidchelimsky.net/2010/07/24/the-rspec-book-beta-14/</link>
		<comments>http://blog.davidchelimsky.net/2010/07/24/the-rspec-book-beta-14/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 01:58:41 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[RSpec]]></category>

		<category><![CDATA[The RSpec Book]]></category>

		<category><![CDATA[rspec-2]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2660</guid>
		<description><![CDATA[The Pragmatic Bookshelf has just released Beta-14 of The RSpec Book.

This is the first beta release since we made the rather ambitious decision to update the book for RSpec-2 and Rails-3, and includes updates to the tutorial in Part I of the book, as well as the first chapter in Part III: Code Examples.

We&#8217;re planning [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pragprog.com/">The Pragmatic Bookshelf</a> has just released Beta-14 of <a href="http://www.pragprog.com/titles/achbd/the-rspec-book">The RSpec Book</a>.</p>

<p>This is the first beta release since we made the rather ambitious decision to update the book for RSpec-2 and Rails-3, and includes updates to the tutorial in Part I of the book, as well as the first chapter in Part III: Code Examples.</p>

<p>We&#8217;re planning two more beta releases over the next couple of weeks. One to update the rest of Part III, and then a final beta release with Part V (the Rails section) updated to RSpec-2 and Rails-3.</p>

<p>What this means for the short run is that 1/2 of the beta book uses newer gem versions, while the rest uses the old versions. We thought for a long time about whether to delay this beta until it was all up to date, but decided in the end that beta readers had waited long enough&#8212;now that RSpec 2 and Rails 3 release candidates are just around the corner, we wanted to get this new content out as soon as we could. Keep in mind that this is only for a week or two, while we put the finishing touches on the book.</p>

<p>With that in mind, here is some information that will help you navigate the beta book:</p>

<h3>Ruby 1.8.7</h3>

<p>The code examples in the book were written using Ruby 1.8.7. Most of them, but not all, will work with 1.9.2-rc2.</p>

<h3>Code for the updated chapters in beta-14</h3>

<p>While we&#8217;re getting these last few beta releases out, the updated chapters all have red headers, like this:</p>

<p><img src="http://blog.davidchelimsky.net/wp-content/uploads/2010/07/screen-shot-2010-07-23-at-75308-pm.png" alt="Updated Section Header" /></p>

<p>The examples in these chapters work with the following gem versions:</p>

<pre><code>rspec-2.0.0.beta.18
cucumber-0.8.5
</code></pre>

<h3>Code for the rest of the chapters in beta-14</h3>

<p>The chapters that have not been updated yet have gray headers, like this:</p>

<p><img src="http://blog.davidchelimsky.net/wp-content/uploads/2010/07/screen-shot-2010-07-23-at-75430-pm.png" alt="Non-updated Section Header" /></p>

<p>The examples in these chapters work with the following gem versions:</p>

<pre><code>rspec-1.3.0
rspec-rails-1.3.2
rails-2.3.5
cucumber-0.6.2
cucumber-rails-0.2.4
database_cleaner-0.4.3
webrat-0.7.0
selenium-client-0.2.18
</code></pre>

<h3>Reporting Errata</h3>

<h4>Technical errors in the updated chapters</h4>

<p>We are now in the final phases of preparing the book for print. For those of you reading the beta book, we are very interested in <em>technical errata in the updated chapters</em>. If the behaviour of any examples in the updated chapters differs from what the book tells you to expect <em>with the versions listed above</em>, please report that to <a href="http://www.pragprog.com/titles/achbd/errata">http://www.pragprog.com/titles/achbd/errata</a>.</p>

<h4>Copyedit issues</h4>

<p>The book has not been through copyedit yet (that&#8217;s next), so please don&#8217;t worry about spelling, grammar, or phrasing. That will all be addressed by our very able copyeditor.</p>

<h4>Typesetting issues</h4>

<p>The book has not been formally typeset yet (that&#8217;s last), so please don&#8217;t worry about code examples that span page turns, or issues with syntax highlighting.</p>

<h4>Other technical errors</h4>

<p>If you find that the behaviour works differently with newer Ruby or gem versions than those listed above, please submit bug reports to the appropriate trackers:</p>

<ul>
<li><a href="http://github.com/rspec/rspec-core">rspec-core (describe/it/etc)</a></li>
<li><a href="http://github.com/rspec/rspec-expectations">rspec-expectations (should/should_not + matchers)</a></li>
<li><a href="http://github.com/rspec/rspec-mocks">rspec-mocks</a></li>
<li><a href="http://github.com/rspec/rspec-rails">rspec-rails</a></li>
<li><a href="http://rspec.lighthouseapp.com/projects/16211">cucumber</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/07/24/the-rspec-book-beta-14/feed/</wfw:commentRss>
		</item>
		<item>
		<title>rspec-rails-2 generators and rake tasks - part II</title>
		<link>http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks-part-ii/</link>
		<comments>http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks-part-ii/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 22:41:10 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[generators]]></category>

		<category><![CDATA[rails-3]]></category>

		<category><![CDATA[rake tasks]]></category>

		<category><![CDATA[rspec-2]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2653</guid>
		<description><![CDATA[Some questions have come up since I posted about rspec-rails-2 generators and rake tasks requiring that rspec-rails be declared in the :development group in a Gemfile. Here are a few of them, paraphrased, with answers:

Why the change?

rspec-rails now uses a Railtie to expose the rake tasks and generators. Railties allow Rails extensions to register themselves [...]]]></description>
			<content:encoded><![CDATA[<p>Some questions have come up since I posted about <a href="http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks">rspec-rails-2 generators and rake tasks</a> requiring that rspec-rails be declared in the <code>:development</code> group in a Gemfile. Here are a few of them, paraphrased, with answers:</p>

<h3>Why the change?</h3>

<p>rspec-rails now uses a Railtie to expose the rake tasks and generators. Railties allow Rails extensions to register themselves with Rails without having to copy files into your app. This makes installation and, especially, upgrades much easier to manage for both maintainers and users.</p>

<h3>Do I need rspec-rails in both :development and :test groups?</h3>

<h4>:development</h4>

<p>We need rspec-rails in the <code>:development</code> group in order to expose the rake tasks and generators without having to type <code>RAILS_ENV=test</code> when we want to use them.</p>

<h4>:test</h4>

<p>Quite ironically, it turns out that we don&#8217;t need it in the :test group at all. That may change in the future, and I don&#8217;t see any harm in keeping it in the :test group as well, so I&#8217;ll probably keep it there in my apps.</p>

<h3>Doesn&#8217;t that mean I&#8217;m loading rspec-rails and all of its dependencies in the :development environment?</h3>

<p>No, and herein lies the benefit of using a Railtie for this.</p>

<p>When you declare a gem in a Gemfile, Bundler loads up a file with the same name as the gem, in our case <a href="http://github.com/rspec/rspec-rails/blob/master/lib/rspec-rails.rb"><code>rspec-rails.rb</code></a>.</p>

<script src="http://gist.github.com/471892.js?file=rspec-rails.rb"></script>

<p>The generator configs are only invoked when running <code>rails generate</code>, which is when you want them.  The <code>require</code> statement is only invoked when running <code>rake</code>, which is when you want it. If you&#8217;re not running <code>rake</code> or <code>rails generate</code>, then no other files from rspec-rails or any of its dependencies are loaded, <em>unless you load them explicitly from elsewhere in your app</em>.</p>

<h3>Does this actually work? When I add rspec-rails to the :development group and run <code>rails generate</code>, I don&#8217;t see most of the rspec generators.</h3>

<p>The only RSpec generator that is intended to be invoked directly is <code>rspec:install</code>, which you&#8217;ll still see. The others are invoked implicitly by Rails when you run the various Rails generators. e.g., if you run <code>script/rails generate controller Widgets</code>, the controller generator implicitly calls out to the <code>rspec:controller</code> generator to generate a <code>WidgetsController</code> spec.</p>

<p>Because these are intended to be implicit, Rails hides them from you in order to reduce the noise level.</p>

<h3>OK, but now I see all of the <code>test_unit</code> generators. What&#8217;s up with those?</h3>

<p>Because RSpec is the test framework of record, Rails doesn&#8217;t know to hide the test_unit generators. <strike>If you want to hide them, just add this to one of your config files:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">Rails::Generators</span>.<span style="color:#9900CC;">hide_namespace</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;test_unit&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>


<p></strike></p>

<p>[Updated on 7//14]</p>

<p>Turns out that <code>hide_namespaces</code> doesn&#8217;t work for this use case. I&#8217;ve got an <a href="https://rails.lighthouseapp.com/projects/8994/tickets/5111">open ticket in the Rails tracker</a> to address this, and I&#8217;ll updated this post again once it&#8217;s addressed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks-part-ii/feed/</wfw:commentRss>
		</item>
		<item>
		<title>rspec-rails-2 generators and rake tasks</title>
		<link>http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks/</link>
		<comments>http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 12:48:59 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[RSpec]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[rails-3]]></category>

		<category><![CDATA[rspec-2]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2649</guid>
		<description><![CDATA[As of rspec-rails-2.0.0.beta.17, generators and rake tasks are exposed through a Railtie. In order to see them when you run rails generate and rake -T, you need to include the rspec-rails gem in the :development group in your Gemfile.


group :development, :test do
  gem &#34;rspec-rails&#34;, &#34;&#62;= 2.0.0.beta.17&#34;
end


If you have a previous version of rspec-rails-2.0.0.beta installed, [...]]]></description>
			<content:encoded><![CDATA[<p>As of <a href="http://github.com/rspec/rspec-rails">rspec-rails-2.0.0.beta.17</a>, generators and rake tasks are exposed through a <a href="http://github.com/rspec/rspec-rails/blob/master/lib/rspec-rails.rb">Railtie</a>. In order to see them when you run <code>rails generate</code> and <code>rake -T</code>, you need to include the <code>rspec-rails</code> gem in the <code>:development</code> group in your <code>Gemfile</code>.</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">group <span style="color:#ff3333; font-weight:bold;">:development</span>, <span style="color:#ff3333; font-weight:bold;">:test</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  gem <span style="color:#996600;">&quot;rspec-rails&quot;</span>, <span style="color:#996600;">&quot;&gt;= 2.0.0.beta.17&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>If you have a previous version of <code>rspec-rails-2.0.0.beta</code> installed, you should also remove these files:</p>

<p><pre>
lib/tasks/rspec.rake
config/initializers/rspec_generator.rb
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/07/11/rspec-rails-2-generators-and-rake-tasks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RSpec-2 Documentation</title>
		<link>http://blog.davidchelimsky.net/2010/07/01/rspec-2-documentation/</link>
		<comments>http://blog.davidchelimsky.net/2010/07/01/rspec-2-documentation/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 12:54:19 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[BDD]]></category>

		<category><![CDATA[RSpec]]></category>

		<category><![CDATA[rspec-2]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2647</guid>
		<description><![CDATA[RSpec-2 is getting close to a release candidate, and as the beta gems have been flowing a lot of questions have been coming in, especially about documentation. Here is some information that should help.

Source code

RSpec development has moved to the rspec account on github. There are five repositories at the moment:


http://github.com/rspec/rspec
http://github.com/rspec/rspec-core
http://github.com/rspec/rspec-expectations
http://github.com/rspec/rspec-mocks
http://github.com/rspec/rspec-rails


rspec-rails depends on rspec, which [...]]]></description>
			<content:encoded><![CDATA[<p>RSpec-2 is getting close to a release candidate, and as the beta gems have been flowing a lot of questions have been coming in, especially about documentation. Here is some information that should help.</p>

<h2>Source code</h2>

<p>RSpec development has moved to the <a href="http://github.com/rspec">rspec</a> account on github. There are five repositories at the moment:</p>

<ul>
<li><a href="http://github.com/rspec/rspec">http://github.com/rspec/rspec</a></li>
<li><a href="http://github.com/rspec/rspec-core">http://github.com/rspec/rspec-core</a></li>
<li><a href="http://github.com/rspec/rspec-expectations">http://github.com/rspec/rspec-expectations</a></li>
<li><a href="http://github.com/rspec/rspec-mocks">http://github.com/rspec/rspec-mocks</a></li>
<li><a href="http://github.com/rspec/rspec-rails">http://github.com/rspec/rspec-rails</a></li>
</ul>

<p><a href="http://github.com/rspec/rspec-rails">rspec-rails</a> depends on <a href="http://github.com/rspec/rspec">rspec</a>, which depends, in turn, on the other three.</p>

<p>This structure has many benefits, but one cost is that the documentation, though plentiful, is a bit scattered.</p>

<h2>READMEs</h2>

<ul>
<li><a href="http://github.com/rspec/rspec">http://github.com/rspec/rspec</a></li>
<li><a href="http://github.com/rspec/rspec-core">http://github.com/rspec/rspec-core</a></li>
<li><a href="http://github.com/rspec/rspec-expectations">http://github.com/rspec/rspec-expectations</a></li>
<li><a href="http://github.com/rspec/rspec-mocks">http://github.com/rspec/rspec-mocks</a></li>
<li><a href="http://github.com/rspec/rspec-rails">http://github.com/rspec/rspec-rails</a></li>
</ul>

<h2>Upgrade Notes</h2>

<ul>
<li><a href="http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown">http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown</a></li>
<li><a href="http://github.com/rspec/rspec-expectations/blob/master/Upgrade.markdown">http://github.com/rspec/rspec-expectations/blob/master/Upgrade.markdown</a></li>
<li><a href="http://github.com/rspec/rspec-rails/blob/master/Upgrade.markdown">http://github.com/rspec/rspec-rails/blob/master/Upgrade.markdown</a></li>
</ul>

<h2>Cucumber features</h2>

<p>Each of the repos has a growing set of Cucumber features. Some of the features have been added in after the fact, but many of the new features have been driven out using Cucumber. These are a great source of &#8220;How-To&#8221; information, and you <em>know</em> they&#8217;re up to date because they are <em>executable documentation</em>.</p>

<p>If you peruse these and are unable to find the information you&#8217;re looking for, or find any of the information incomplete or confusing, please, please, please submit a github issue (see Known Issues, below). Or, better yet, submit a patch!</p>

<ul>
<li><a href="http://github.com/rspec/rspec-core/tree/master/features/">http://github.com/rspec/rspec-core/tree/master/features/</a></li>
<li><a href="http://github.com/rspec/rspec-expectations/tree/master/features/">http://github.com/rspec/rspec-expectations/tree/master/features/</a></li>
<li><a href="http://github.com/rspec/rspec-mocks/tree/master/features/">http://github.com/rspec/rspec-mocks/tree/master/features/</a></li>
<li><a href="http://github.com/rspec/rspec-rails/tree/master/features/">http://github.com/rspec/rspec-rails/tree/master/features/</a></li>
</ul>

<h2>RDoc</h2>

<p>The RDoc is arguably the weakest link here. Patches welcome!</p>

<ul>
<li><a href="http://rdoc.info/projects/rspec/rspec-core">http://rdoc.info/projects/rspec/rspec-core</a></li>
<li><a href="http://rdoc.info/projects/rspec/rspec-expectations">http://rdoc.info/projects/rspec/rspec-expectations</a></li>
<li><a href="http://rdoc.info/projects/rspec/rspec-mocks">http://rdoc.info/projects/rspec/rspec-mocks</a></li>
<li><a href="http://rdoc.info/projects/rspec/rspec-rails">http://rdoc.info/projects/rspec/rspec-rails</a></li>
</ul>

<h2>Known Issues</h2>

<p>Issues for rspec-2 are being maintained on github.</p>

<ul>
<li><a href="http://github.com/rspec/rspec-core/issues">http://github.com/rspec/rspec-core/issues</a></li>
<li><a href="http://github.com/rspec/rspec-expectations/issues">http://github.com/rspec/rspec-expectations/issues</a></li>
<li><a href="http://github.com/rspec/rspec-mocks/issues">http://github.com/rspec/rspec-mocks/issues</a></li>
<li><a href="http://github.com/rspec/rspec-rails/issues">http://github.com/rspec/rspec-rails/issues</a></li>
</ul>

<p>If you want to submit an issue and you&#8217;re not sure which tracker it belongs in, just pick the one you think is most appropriate. I&#8217;m more interested in getting the feedback then you knowing where to put the issue. I&#8217;ll move it to the right place if necessary.</p>

<h2>Wikis</h2>

<p>PLEASE NOTE: github wikis can be updated by anybody with a github account, and I don&#8217;t get any notification when wiki pages have changed. Most of the time, users add valuable information, but the structure is poor and always in flux, and there have been occasions in which the information was either misleading or simply inaccurate. The Cucumber features mentioned above, though currently incomplete, are a much better source for accurate documentation.</p>

<ul>
<li><a href="http://wiki.github.com/rspec/rspec/">http://wiki.github.com/rspec/rspec/</a></li>
<li><a href="http://wiki.github.com/rspec/rspec-core/">http://wiki.github.com/rspec/rspec-core/</a></li>
<li><a href="http://wiki.github.com/rspec/rspec-expectations/">http://wiki.github.com/rspec/rspec-expectations/</a></li>
<li><a href="http://wiki.github.com/rspec/rspec-mocks/">http://wiki.github.com/rspec/rspec-mocks/</a></li>
<li><a href="http://wiki.github.com/rspec/rspec-rails/">http://wiki.github.com/rspec/rspec-rails/</a></li>
</ul>

<h2>The RSpec Book</h2>

<p>The RSpec Book is being updated for RSpec-2 and Rails-3. There will still be references back to RSpec-1 and Rails-2 where things have changed, but the focus will be on the way forward. Once the rails-3 and rspec-2 release candidates are out, we&#8217;ll release one more updated PDF of the book for those in the beta program, and then off to the printer it goes. FINALLY!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/07/01/rspec-2-documentation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>View isolation in rspec-rails-2</title>
		<link>http://blog.davidchelimsky.net/2010/06/28/view-isolation-in-rspec-rails-2/</link>
		<comments>http://blog.davidchelimsky.net/2010/06/28/view-isolation-in-rspec-rails-2/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 03:01:40 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[rspec-2]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2643</guid>
		<description><![CDATA[View isolation is changing in rspec-rails-2. As of beta.14, the view template needs to exist, but the content of the template will not be evaluated. This still provides isolation from the content of the template and its dependencies, it just means the file has to be there, which means you have to create it.

Why this [...]]]></description>
			<content:encoded><![CDATA[<p>View isolation is changing in <a href="http://github.com/rspec/rspec-rails">rspec-rails-2</a>. As of <a href="http://rubygems.org/gems/rspec-rails/versions/2.0.0.beta.14.1">beta.14</a>, <em>the view template needs to exist</em>, but the content of the template will not be evaluated. This still provides isolation from the content of the template and its dependencies, it just means the file has to be there, which means you have to create it.</p>

<h2>Why this change?</h2>

<p>rspec-rails-1 performed some <a href="http://github.com/dchelimsky/rspec-rails/blob/master/lib/spec/rails/example/controller_example_group.rb">serious gymnastics</a> to isolate controller specs from views. As many rspec/rails users well know, all the monkey patching of Rails&#8217; internals led to rspec-rails releases immediately following rails releases.</p>

<p>Thankfully, Rails 3 exposes very clean extension points and APIs that make it far simpler to get the most important part of this isolation: isolation from the content of the template.</p>

<h2>Rails 3 Resolvers</h2>

<p>Rails makes a number of decisions based on the existence or lack thereof of a given template on the file system. Rails 3 also supports custom resolvers that let you store view templates in a database, for example. Given the wide array of possibilities, it is not possible for RSpec to predict every way in which templates will be stored or accessed.</p>

<p>What RSpec <em>can</em> do, and does as of beta.14, is use the Rails machinery, or custom extensions that adhere to the Rails Resolver API, to find and load templates, and then stub out the content. Doing so requires <a href="http://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/view_rendering.rb">much less code</a> and, more importantly, much less invasive code. This increases the likelihood that new features in Rails will <em>just work</em> with rspec-rails as it is, and decreases the likelihood that changes to Rails&#8217; internals will require rspec-rails to release updates with every new release of Rails.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/06/28/view-isolation-in-rspec-rails-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why you want a topic branch when contributing to git-hosted projects</title>
		<link>http://blog.davidchelimsky.net/2010/06/24/why-you-want-a-topic-branch-when-contributing-to-git-hosted-projects/</link>
		<comments>http://blog.davidchelimsky.net/2010/06/24/why-you-want-a-topic-branch-when-contributing-to-git-hosted-projects/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 11:23:57 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2639</guid>
		<description><![CDATA[When contributing to a git(hub)-hosted open source project, it is often recommended that you follow these steps:


fork the repo
make changes on a topic branch
push the branch to your repo
send a pull request or link to the commit from a ticket


I was recently asked whether the topic branch in step 2 was necessary. The answer is [...]]]></description>
			<content:encoded><![CDATA[<p>When contributing to a git(hub)-hosted open source project, it is often recommended that you follow these steps:</p>

<ul>
<li>fork the repo</li>
<li>make changes on a topic branch</li>
<li>push the branch to your repo</li>
<li>send a pull request or link to the commit from a ticket</li>
</ul>

<p>I was recently asked whether the topic branch in step 2 was necessary. The answer is that it&#8217;s not really necessary, it just makes life easier for both the contributor and the maintainer. Here&#8217;s why.</p>

<p>When maintainers merge patches, they often modify commit messages: rewording for consistency in the commit logs, sign-off statements, etc. They&#8217;ll also sometimes change the actual content of the commit to fix typos, reorganize methods in a file, etc, etc.</p>

<p>In either case, the result is that the commit that gets merged to the mainline repo has a different sha1 than the commit you submitted. This means that when you go to merge the mainline master branch back into your master branch, you&#8217;ll run into conflicts. Then, if you resolve them, the HEAD of your master branch is not the same as the HEAD of the mainline master branch, so the next patch you submit off your master branch will likely not apply easily.</p>

<p>By keeping your patches on topic branches, you&#8217;re able to keep your master branch aligned with the mainline master branch. This makes it easier for you to submit more patches later. It also makes it more likely that your contributions will apply cleanly, which increases the likelihood that they&#8217;ll be accepted.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/06/24/why-you-want-a-topic-branch-when-contributing-to-git-hosted-projects/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Filtering examples in rspec-2</title>
		<link>http://blog.davidchelimsky.net/2010/06/14/filtering-examples-in-rspec-2/</link>
		<comments>http://blog.davidchelimsky.net/2010/06/14/filtering-examples-in-rspec-2/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 13:08:20 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[RSpec]]></category>

		<category><![CDATA[rspec-2]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2625</guid>
		<description><![CDATA[In RSpec-2, every example group and example has associated metadata, to which you can append arbitrary information. This allows you to slice and dice a spec suite in a variety of ways.

Adding arbitrary metadata

The describe and it methods, and their aliases, each accept a hash as the last argument before the block:


describe &#34;something&#34;, :this =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="">RSpec-2</a>, every example group and example has associated metadata, to which you can append arbitrary information. This allows you to slice and dice a spec suite in a variety of ways.</p>

<h3>Adding arbitrary metadata</h3>

<p>The <code>describe</code> and <code>it</code> methods, and their aliases, each accept a hash as the last argument before the block:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe <span style="color:#996600;">&quot;something&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:this</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:is <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:arbitrary</span><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  it <span style="color:#996600;">&quot;does something&quot;</span>, :<span style="color:#9966CC; font-weight:bold;">and</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;so is this&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ...</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<h3><code>filter_run</code></h3>

<p>The keys in these hashes can be accessed in a number of ways via <code>RSpec.configure</code>. If, for example, you&#8217;re working on a specific example and don&#8217;t want to run the full suite, you can use the <code>filter_run</code> method on the configuration like this:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># in spec/spec_helper.rb</span>
RSpec.<span style="color:#9900CC;">configure</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span>
  c.<span style="color:#9900CC;">filter_run</span> <span style="color:#ff3333; font-weight:bold;">:focus</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># in spec/any_spec.rb</span>
describe <span style="color:#996600;">&quot;something&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  it <span style="color:#996600;">&quot;does something&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:focus</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ....</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>Now if you run <code>rspec spec</code>, it will only run that one example, no matter how many others there are in the suite.</p>

<p>This works for examples and groups, so if you want to run all the examples in one group that you&#8217;re focusing on, but nothing else, you can do this:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">RSpec.<span style="color:#9900CC;">configure</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span>
  c.<span style="color:#9900CC;">filter_run</span> <span style="color:#ff3333; font-weight:bold;">:focus</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
describe <span style="color:#996600;">&quot;something&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:focus</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  it <span style="color:#996600;">&quot;does something&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ....</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  it <span style="color:#996600;">&quot;does something else&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ....</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>The <code>rspec</code> command would now run both of the examples in that group.</p>

<h3><code>filter_run_excluding</code></h3>

<p>This is the inverse of <code>filter_run</code>. It excludes any examples or groups that match the filter:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">RSpec.<span style="color:#9900CC;">configure</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span>
  c.<span style="color:#9900CC;">filter_run_excluding</span> <span style="color:#ff3333; font-weight:bold;">:slow</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
describe <span style="color:#996600;">&quot;something&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:slow</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  it <span style="color:#996600;">&quot;does something&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ....</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  it <span style="color:#996600;">&quot;does something else&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ....</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>The <code>rspec</code> command would now run all the other examples in the suite, but not these two.</p>

<p>NOTE: <code>filter_run_excluding</code> was added in beta.12, which was just released this morning.</p>

<h3><code>lambda</code></h3>

<p>You can filter on runtime conditions by assigning a lambda to a key. If your app is expected to behave differently in different versions of Ruby, you can use a <code>lambda</code> with <code>filter_run_excluding</code> like this:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">RSpec.<span style="color:#9900CC;">configure</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span>
  c.<span style="color:#9900CC;">filter_run_excluding</span> <span style="color:#ff3333; font-weight:bold;">:ruby</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>version<span style="color:#006600; font-weight:bold;">|</span>
    !<span style="color:#006600; font-weight:bold;">&#40;</span>RUBY_VERSION.<span style="color:#9900CC;">to_s</span> =~ <span style="color:#006600; font-weight:bold;">/</span>^<span style="color:#008000; font-style:italic;">#{version.to_s}/)</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
describe <span style="color:#996600;">&quot;something&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  it <span style="color:#996600;">&quot;does something&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:ruby</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> 1.8 <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ....</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  it <span style="color:#996600;">&quot;does something&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:ruby</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> 1.9 <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># ....</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>This example comes directly from rspec-core&#8217;s own <code>spec_helper.rb</code>.</p>

<p>RSpec passes 1.8 and 1.9 to the lambda, which accepts it as the <code>version</code> block argument. If the lambda returns <code>true</code>, the example is <em>excluded</em> from the run (because we&#8217;re using <code>filter_run_excluding</code>). Now the first example will only run if the ruby version is 1.8. Similarly, the latter example only runs under 1.9.</p>

<h3>(no) command line support (yet)</h3>

<p>We plan to add some sort of command line API to access these filters, but we&#8217;re not sure yet what this is going to look like. There is an <a href="http://github.com/rspec/rspec-core/issues/37">open issue in github issues for rspec-core</a> . Please feel free to review and add any comments there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/06/14/filtering-examples-in-rspec-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>rspec-2 and autotest</title>
		<link>http://blog.davidchelimsky.net/2010/03/15/rspec-2-and-autotest/</link>
		<comments>http://blog.davidchelimsky.net/2010/03/15/rspec-2-and-autotest/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 11:59:15 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[Autotest]]></category>

		<category><![CDATA[RSpec]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2621</guid>
		<description><![CDATA[[Updated on 17 March, 2010]

I just released rspec-2.0.0.beta.4 with support for autotest, among other enhancements. Autotest integration is going to be a bit different in rspec-2. We&#8217;re removing the autospec command, which did nothing but set an environment variable and call autotest.

In rspec-2, you&#8217;ll use the autotest command directly, but doing so requires a small [...]]]></description>
			<content:encoded><![CDATA[<p>[Updated on 17 March, 2010]</p>

<p>I just released rspec-2.0.0.beta.4 with support for <code>autotest</code>, among other enhancements. Autotest integration is going to be a bit different in rspec-2. We&#8217;re removing the <code>autospec</code> command, which did nothing but set an environment variable and call <code>autotest</code>.</p>

<p>In rspec-2, you&#8217;ll use the <code>autotest</code> command directly, but doing so requires a small bit of configuration. As of beta.4, you&#8217;ll have to do add this configuration manually. Just create an <code>autotest</code> directory in the root of your project, put the following statement in <code>./autotest/discover.rb</code>:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Autotest.<span style="color:#9900CC;">add_discovery</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">&quot;rspec2&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>


<p>The final 2.0.0 release will include a generator (even for non-rails projects) that will add this for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/03/15/rspec-2-and-autotest/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rspec 2.0 in the works</title>
		<link>http://blog.davidchelimsky.net/2010/01/25/rspec-20-in-the-works/</link>
		<comments>http://blog.davidchelimsky.net/2010/01/25/rspec-20-in-the-works/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 03:31:02 +0000</pubDate>
		<dc:creator>David</dc:creator>
		
		<category><![CDATA[RSpec]]></category>

		<guid isPermaLink="false">http://blog.davidchelimsky.net/?p=2609</guid>
		<description><![CDATA[We&#8217;ve started to do some preliminary work on rspec-2.0, which we plan to release before Rails-3 goes final. At that point, the rspec-rails-2.0 plugin/gem will only work with rspec >= 2.0 and rails >= 3.0.

We&#8217;re committed to making the upgrade from rspec-1.x to rspec-2.0 as seamless as possible for most users, but extenders are going [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve started to do some preliminary work on rspec-2.0, which we plan to release before Rails-3 goes final. At that point, the rspec-rails-2.0 plugin/gem will only work with rspec >= 2.0 and rails >= 3.0.</p>

<p>We&#8217;re committed to making the upgrade from rspec-1.x to rspec-2.0 as seamless as possible for most users, but extenders are going to see some differences. This is why we&#8217;re going to take our time with alpha, beta, and candidate releases.</p>

<p>Here are some of the improvements you can expect:</p>

<h3>Modularity</h3>

<p>Following the Rails and Merb models, Rspec-2 will be broken up into component gems and a meta-gem that depends on them. Most users will still <code>gem install rspec</code>, and doing so will install the component gems.</p>

<p>We&#8217;ve broken rspec up into 4 repos in the <a href="http://github.com/rspec">rspec account on github</a>:</p>

<ul>
<li>rspec => meta gem that depends on the others</li>
<li>rspec-core => runner and output formatters</li>
<li>rspec-expectations => <code>should</code> and matchers</li>
<li>rspec-mocks => mocks and stubs</li>
</ul>

<p>With separate component repos, you&#8217;ll be able to use rspec as you do today or mix and match components with other frameworks. This will also make it easier for contributors to contribute to the components they are interested in without worrying about other components.</p>

<h3>New runner extracted from Micronaut</h3>

<p>The <a href="http://github.com/rspec/rspec-core">rspec-core</a> repository is a complete rewrite of the runner, which has been a big sore spot over the years for contributors and extenders. We extracted the runner from <a href="http://github.com/spicycode/micronaut">Micronaut</a>, which is an Rspec-compatible framework written by <a href="http://github.com/spicycode">Chad Humphries</a>.</p>

<p>Micronaut has a simple and powerful metadata model, which allows us to easily slice and dice a spec suite in much the same way we do now with Cucumber using tags. It also helps to simplify rspec&#8217;s own specs (because you can access it from within an example).</p>

<p>Because we&#8217;re able to intercept examples before they are run, we&#8217;ll also be able to offer a clean extension API, allowing you to add structures like <a href="http://merbivore.org/">Merb</a>&#8217;s <code>given</code> blocks without monkey patching. Less monkey patching <code>==</code> more maintainable.</p>

<h3>Where we are today</h3>

<p>While Micronaut runs the same specs that Rspec does, there are some different names for things, and there are some differences in the CLI as well. We&#8217;ve started to resolve some of the differences in <a href="http://github.com/rspec/rspec-core">rspec-core</a>, but we have a way to go.</p>

<p>If you want to try it out and see what works and what doesn&#8217;t, you can either install the prerelease gems (2.0.0.a2 as of this writing):</p>

<p><pre>[sudo] gem install rspec --prerelease</pre></p>

<p>You can also grab the dev environment and have a look at the code. See the <a href="http://github.com/rspec/rspec-dev">rspec-dev README</a> for info.</p>

<p><b><em>Please do not start reporting issues yet as this will only slow us down.</em></b></p>

<p>There is a lot that works, but there is also a lot that doesn&#8217;t. Once we get to beta, we&#8217;ll be looking for feedback and contributions, but for now we just want to let you know where things are.</p>

<p>Rspec 2 uses <code>Rspec</code> as the root namespace and installs an <code>rspec</code> command instead of a <code>spec</code> command. Until we release 2.0.0 final, this will make it easy for you to keep things separate on your system and in your apps. Once we go final we&#8217;ll either alias the old names or release a separate backwards-compatibility wrapper gem that does this for you.</p>

<h3>What&#8217;s next</h3>

<p>We want to focus most of our efforts on rspec-2 at this point, so we don&#8217;t plan any new development on the rspec-1.x series. We&#8217;ll do bug-fix releases of rspec[-rails]-1.3, but no new features.</p>

<p>I&#8217;ll follow up with more information as it becomes clear. Look here for announcements about alpha and beta releases if you&#8217;re interested in trying it out early or getting involved.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davidchelimsky.net/2010/01/25/rspec-20-in-the-works/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
