<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>David Chelimsky</title>
    <link>http://blog.davidchelimsky.net/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>on software in process and practice</description>
    <item>
      <title>The &amp;quot;BDD Story Template&amp;quot;</title>
      <description>&lt;p&gt;&lt;a href="http://blog.mountaingoatsoftware.com/"&gt;Mike Cohn&lt;/a&gt; just wrote a &lt;a href="http://blog.mountaingoatsoftware.com/?p=24"&gt;nice post&lt;/a&gt; justifying what has become the &lt;a href="http://dannorth.net/whats-in-a-story"&gt;preferred template for stories in &lt;span class="caps"&gt;BDD&lt;/span&gt;&lt;/a&gt;:&lt;/p&gt;


	&lt;p&gt;As a &lt;i&gt;role&lt;/i&gt;&lt;br/&gt;
I want &lt;i&gt;feature&lt;/i&gt;&lt;br/&gt;
So that &lt;i&gt;benefit&lt;/i&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 28 Apr 2008 02:50:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:f854eff9-eeac-4096-89c6-eeab1de89cd9</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/04/28/the-bdd-story-template</link>
    </item>
    <item>
      <title>RSpec at github</title>
      <description>&lt;p&gt;After a few months of exploring git and hosting &lt;a href="http://rspec.info"&gt;RSpec&amp;#8217;s&lt;/a&gt; git repository at &lt;a href="http://github.com/dchelimsky/rspec"&gt;github&lt;/a&gt;, we&amp;#8217;re happy to announce that github is now RSpec&amp;#8217;s official home for Source Code Management.&lt;/p&gt;


	&lt;p&gt;Tracking will continue to live at the &lt;a href="http://rspec.lighthouseapp.com"&gt;lighthouse&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;We will continue to release gems to &lt;a href="Rubyforge"&gt;http://rubyforge.org/projects/rspec&lt;/a&gt;, but we will no longer be committing changes to the subversion repository there. For Rails users who are using the rspec plugins for Rails, edge rails now supports git-hosted plugins.&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;ve broken the project up into four separate repositories:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://github.com/dchelimsky/rspec/wikis/home"&gt;rspec&lt;/a&gt; for the rspec gem/plugin&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://github.com/dchelimsky/rspec-rails/wikis/home"&gt;rspec-rails&lt;/a&gt; for the rspec-rails gem/plugin (formerly rspec_on_rails)&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://github.com/dchelimsky/rspec-tmbundle/wikis/home"&gt;rspec-tmbundle&lt;/a&gt; for the TextMate bundle&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://github.com/dchelimsky/rspec-dev/wikis/home"&gt;rspec-dev&lt;/a&gt; for developers/contributors&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;See the wikis for each repository for more information about building, installing and contributing to the project.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Apr 2008 13:41:24 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:9c54a1d1-9f2c-4872-8807-dd11cb4818ea</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/04/09/rspec-at-github</link>
      <category>rspec</category>
      <category>git</category>
    </item>
    <item>
      <title>Welcome Pat Maddox</title>
      <description>&lt;p&gt;I&amp;#8217;m pleased to announce that &lt;a href="http://evang.eli.st/blog"&gt;Pat Maddox&lt;/a&gt; is joining the &lt;a href="rspec.info"&gt;RSpec&lt;/a&gt; Development Team.&lt;/p&gt;


	&lt;p&gt;As you may already know, Pat has been contributing great patches and actively participating on the &lt;a href="http://rubyforge.org/mailman/listinfo/rspec-users"&gt;rspec-users&lt;/a&gt; and &lt;a href="http://rubyforge.org/mailman/listinfo/rspec-devel"&gt;rspec-devel&lt;/a&gt; mailing lists for quite some time. He has demonstrated a deep understanding of Behaviour Driven Development in general, and specifically as it applies to Rails, which has certainly posed some of the more interesting questions on our mailing lists.&lt;/p&gt;


	&lt;p&gt;We are all excited to have Pat on board and look forward to his continued contribution.&lt;/p&gt;</description>
      <pubDate>Fri, 04 Apr 2008 09:27:31 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:98043e70-7f55-4910-9fa6-4910de330480</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/04/04/welcome-pat-maddox</link>
      <category>rspec</category>
    </item>
    <item>
      <title>ETEC Slides</title>
      <description>&lt;p&gt;Here are the &lt;a href="http://www.chariotsolutions.com/slides/pdfs/ete2008-IntegrationTestingWithRSpec.pdf"&gt;slides&lt;/a&gt; from my presentation at &lt;a href="http://www.phillyemergingtech.com/"&gt;Emerging Technologies for the Enterprise&lt;/a&gt; on &lt;a href="http://www.phillyemergingtech.com/abstracts.php#chelimsky"&gt;Integration Testing with RSpec&amp;#8217;s Story Runner&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Tue, 01 Apr 2008 10:21:59 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:47b22ae9-2083-4578-aaec-da1d54043821</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/04/01/etec-slides</link>
      <category>etec</category>
      <category>conferences</category>
    </item>
    <item>
      <title>limiting scope of autotest</title>
      <description>&lt;p&gt;If you use &lt;a href="http://zentest.rubyforge.org/ZenTest/classes/Autotest.html"&gt;autotest&lt;/a&gt; with &lt;a href="http://rspec.info"&gt;rspec&lt;/a&gt; or test/unit, you&amp;#8217;ve probably had this experience (or one like it):&lt;/p&gt;


	&lt;p&gt;You want to add some new behaviour to a model object, so you write a spec, watch it fail, make it pass, and then wait until the entire spec suite runs. Even if you&amp;#8217;ve got a fast-running suite, this can be painful sometimes.&lt;/p&gt;


	&lt;p&gt;Wouldn&amp;#8217;t it be great if you could limit the scope of what directories autotest observes?  Well it turns out that you can! Recent releases of ZenTest include a find_directories attribute on the autotest object. Just add this to your .autotest file:&lt;/p&gt;


&lt;pre&gt;
Autotest.add_hook :initialize do |at|
  unless ARGV.empty?
    at.find_directories = ARGV.dup
  end
end
&lt;/pre&gt;

	&lt;p&gt;and then you can say:&lt;/p&gt;


&lt;pre&gt;
autotest app/models spec/models
&lt;/pre&gt;

	&lt;p&gt;and it will only observe those directories. This is nice and flexible, but I find that most of the time I&amp;#8217;m wanting pairs like that: app/models and spec/models, or app/views/accounts and spec/views/accounts. In that case, I&amp;#8217;d really like to just say:&lt;/p&gt;


&lt;pre&gt;
autotest models
&lt;/pre&gt;

	&lt;p&gt;To accomplish that you can do this to the hook instead:&lt;/p&gt;


&lt;pre&gt;
Autotest.add_hook :initialize do |at|
  unless ARGV.empty?
    at.find_directories = ["spec/#{ARGV.first}","app/#{ARGV.first}"]
  end
end
&lt;/pre&gt;

	&lt;p&gt;Want the best of both worlds? Try this:&lt;/p&gt;


&lt;pre&gt;
Autotest.add_hook :initialize do |at|
  unless ARGV.empty?
    at.find_directories = ARGV.length == 1 ? ["spec/#{ARGV.first}","app/#{ARGV.first}"] : ARGV.dup
  end
end
&lt;/pre&gt;

	&lt;p&gt;The only limitation of this is that it&amp;#8217;s based on directories, not files. Once in a while, when I&amp;#8217;m bootstrapping a new object, I&amp;#8217;ll keep the examples and the implementation in the same file until I&amp;#8217;ve got things fleshed out a bit the object is ready to play nice with others. In that case, I might like to just point autotest to that one file. I started working on a patch for this for ZenTest, but I&amp;#8217;m not sure it&amp;#8217;s worth the extra effort. What do you think?&lt;/p&gt;


	&lt;p&gt;Regardless &amp;#8211; happy auto-exemplifying!&lt;/p&gt;</description>
      <pubDate>Wed, 05 Mar 2008 02:07:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:7b63be47-39a5-428f-9a6f-13e2f1542a04</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/03/05/limiting-scope-of-autotest</link>
      <category>rspec</category>
      <category>bdd</category>
      <category>autotest</category>
    </item>
    <item>
      <title>Presenting at ETEC</title>
      <description>&lt;p&gt;I&amp;#8217;m going to be presenting at &lt;a href="http://www.phillyemergingtech.com/index.php"&gt;&lt;span class="caps"&gt;ETEC&lt;/span&gt;&lt;/a&gt; on &lt;a href="http://rspec.info"&gt;RSpec&amp;#8217;s&lt;/a&gt; Story Runner. This will be more or less the same talk I&amp;#8217;m &lt;a href="http://blog.davidchelimsky.net/articles/2008/01/26/presenting-at-railsconf-2008"&gt;presenting at RailsConf&lt;/a&gt; in May, except that it&amp;#8217;s in March and on the other coast.&lt;/p&gt;


	&lt;p&gt;See you in Philly!&lt;/p&gt;</description>
      <pubDate>Mon, 04 Feb 2008 10:47:12 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:277fb38f-7e33-459e-9797-d541f56bb62b</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/02/04/presenting-at-etec</link>
      <category>conferences</category>
    </item>
    <item>
      <title>RSpec-1.1.3 and ZenTest-3.9.1</title>
      <description>&lt;p&gt;ZenTest&amp;#8217;s last two releases are not compatible with previous versions of RSpec. This is &lt;strong&gt;good news&lt;/strong&gt; because Autotest now exposes better extension points for subclasses like those that ship with RSpec. Before, RSpec had to monkey patch Autotest to control the mappings of specs to files to run, and the list of files/directories to ignore. Now RSpec gets to use public methods (instead of instance variables) and documented hooks to do it&amp;#8217;s work.&lt;/p&gt;


	&lt;p&gt;In the long run, this will keep things more flexible for both RSpec and ZenTest. In the short run, the catch for you is that you have to use compatible versions of RSpec and ZenTest. They are:&lt;/p&gt;


&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;RSpec version&lt;/th&gt;&lt;th&gt;ZenTest version&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&amp;lt;= 1.1.1&lt;/td&gt;&lt;td&gt;&amp;lt;= 3.7.x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;1.1.2&lt;/td&gt;&lt;td&gt;3.8.x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;1.1.3&lt;/td&gt;&lt;td&gt;3.9.x&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;</description>
      <pubDate>Mon, 04 Feb 2008 03:04:57 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8f236be2-fa8c-4162-8590-d954d4cf8654</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/02/04/rspec-1-1-3-and-zentest-3-9-1</link>
      <category>rspec</category>
      <category>zentest</category>
      <category>autotest</category>
    </item>
    <item>
      <title>Presenting at RailsConf 2008</title>
      <description>&lt;p&gt;I&amp;#8217;m going to be presenting at &lt;a href="http://en.oreilly.com/rails2008/public/content/home"&gt;RailsConf 2008&lt;/a&gt; on &lt;a href="http://rspec.info"&gt;RSpec&amp;#8217;s&lt;/a&gt; Story Runner. I&amp;#8217;ll be talking about how I approach writing for the Story Runner and address several related issues including:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;plain text stories vs pure Ruby (when is which appropriate?)&lt;/li&gt;
		&lt;li&gt;extending the RailsStory with custom helpers&lt;/li&gt;
		&lt;li&gt;testing forms using &lt;a href="http://agilewebdevelopment.com/plugins/webrat"&gt;webrat&lt;/a&gt; within the Story Runner&lt;/li&gt;
		&lt;li&gt;finding a balance of domain and UI scenarios&lt;/li&gt;
		&lt;li&gt;duplication between stories/scenarios and model/view/controller/helper examples&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;That&amp;#8217;s probably already more than I can cover fairly in a 45 minute presentation, but feel free to make other suggestions if you have them.&lt;/p&gt;


	&lt;p&gt;See you in Portland!&lt;/p&gt;</description>
      <pubDate>Sat, 26 Jan 2008 12:15:59 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6056951a-8987-4b51-a49b-62397ec2e1af</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/01/26/presenting-at-railsconf-2008</link>
      <category>rails</category>
      <category>ruby</category>
      <category>railsconf</category>
      <category>conferences</category>
    </item>
    <item>
      <title>RSpec: new --pattern option</title>
      <description>&lt;p&gt;I&amp;#8217;m not in the habit of blogging every change we make to RSpec, but this one &lt;strong&gt;may&lt;/strong&gt; change the way your suite behaves if you have not been following convention.&lt;/p&gt;


	&lt;p&gt;As of RSpec&amp;#8217;s trunk revision 3246 there is a new command line option that lets you control the filename pattern to match. This allows you to restrict files that are loaded when running the spec command in the same way that you can with rake. It also means that helper files that you may depend on are no longer loaded implicitly.&lt;/p&gt;


	&lt;p&gt;The default is:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;"**/*_spec.rb".
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;To get rspec to behave as it did before this change, use this:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;--pattern "**/*.rb" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;If you prefer naming your spec files &amp;#8220;foo_example.rb&amp;#8221;, you can do this:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;--pattern "**/*_example.rb" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;You can also supply multiple patterns (comma separated):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;--pattern "**/*_example.rb, **/*_spec.rb" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This is a very handy way to avoid loading resource files (helpers, matchers, etc) except when you require them explicitly from other files.&lt;/p&gt;


	&lt;p&gt;This is currently only in trunk, but will be part of the next release.&lt;/p&gt;</description>
      <pubDate>Sun, 20 Jan 2008 13:04:47 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:962a4799-5c0f-4010-ba0b-933142dd23eb</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/01/20/rspec-new-pattern-option</link>
      <category>rspec</category>
    </item>
    <item>
      <title>RSpec-1.1.2 and ZenTest-3.8.0</title>
      <description>&lt;p&gt;The &lt;a href="http://rspec.info"&gt;RSpec-1.1.2&lt;/a&gt; release includes changes to keep RSpec compatible with autotest in &lt;a href="http://zentest.rubyforge.org/ZenTest/"&gt;ZenTest-3.8.0&lt;/a&gt;. This new ZenTest release boasts an improved cascading configuration model that works well for subclasses (like those that ship with RSpec) &lt;strong&gt;and&lt;/strong&gt; allows users to override the mappings of specs (or tests) to code as well as the list of files that get ignored by autotest.&lt;/p&gt;


	&lt;p&gt;To support this, Autotest now loads the following files in the following order:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Autotest
AutotestSubClass
~/.autotest
./.autotest
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This allows RSpec (or any other library) to override defaults set in &lt;code&gt;Autotest&lt;/code&gt;, and then provides users both generic (~/.autotest) and project specific (./.autotest) control over the mappings and exceptions.&lt;/p&gt;


	&lt;p&gt;How can you take advantage of this?&lt;/p&gt;


	&lt;p&gt;When autotest begins to run, it calls its &lt;code&gt;:initialize&lt;/code&gt; hook. This hook is exposed by the &lt;code&gt;add_hook&lt;/code&gt; method. You can use this to access the mappings and exceptions using the following methods on Autotest:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
clear_mappings()
add_mapping(regexp, proc)
remove_mapping(regexp)

clear_exceptions()
add_exception(string)
remove_exception(string)
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;add_mapping&lt;/h4&gt;


	&lt;p&gt;The &lt;code&gt;add_mapping&lt;/code&gt; method adds a key/value pair to a hash that maps regexps to procs. Whenever autotest senses that a file is touched, it looks for the regexp that matches the file name and the runs all the files returned by the associated proc.&lt;/p&gt;


	&lt;p&gt;Imagine you&amp;#8217;re working on a shopping cart app. You have some currency conversion behaviour in a &lt;code&gt;Product&lt;/code&gt; model that you&amp;#8217;d like to extract to an &lt;code&gt;acts_as_currency&lt;/code&gt; plugin, and you want autotest to observe the process. You might add a mapping like this to .autotest:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Autotest.add_hook :initialize do |at|
  at.add_mapping(%r%^plugins/acts_as_currency/lib/.*\.rb$%) {
    at.files_matching %r%^spec/models/product_spec\.rb$% +
    at.files_matching %r%^plugins/acts_as_currency/spec/.*_spec\.rb$%
  }
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;In this case, a change to any of the files in the plugin&amp;#8217;s lib directory would cause all the plugins specs to run, as well as the spec for the &lt;code&gt;Product&lt;/code&gt; model.&lt;/p&gt;


	&lt;h4&gt;add_exception&lt;/h4&gt;


	&lt;p&gt;The &lt;code&gt;add_exception&lt;/code&gt; method adds paths to a list of paths that Autotest ignores.&lt;/p&gt;


	&lt;p&gt;I like to run autotest in verbose mode (&lt;code&gt;autotest -v&lt;/code&gt;) because it tells me when I change a file that it doesn&amp;#8217;t know what to do with. The drawback is that it wants to tell me every time I commit because files in the .svn/.hg/.git directories change. So I&amp;#8217;ve got these all listed as exceptions in my ~/.autotest file, along with assorted others:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Autotest.add_hook :initialize do |at|
  %w{.svn .hg .git}.each {|exception|at.add_exception(exception)}
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Note that autotest compiles this list to a Regexp with no anchors, so .hgignore and .gitignore would also get ignored in this case.&lt;/p&gt;


	&lt;h4&gt;Cascading config and granular control&lt;/h4&gt;


	&lt;p&gt;One of the coolest changes in ZenTest-3.8.0 is that autotest loads both ~/.autotest and ./.autotest. So now you can have the hooks you like on every project (like growl notifation) all in one place and still have project specific settings.&lt;/p&gt;


	&lt;p&gt;This also allows you to set up global mappings/exceptions and modify them at the project level. See &lt;a href="http://zentest.rubyforge.org/ZenTest/classes/Autotest.html"&gt;Autotest&amp;#8217;s RDoc&lt;/a&gt; for more info.&lt;/p&gt;</description>
      <pubDate>Tue, 15 Jan 2008 01:15:55 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:2db4938a-328f-473c-bbdc-0ec0e80ef56f</guid>
      <author>David</author>
      <link>http://blog.davidchelimsky.net/articles/2008/01/15/rspec-1-1-2-and-zentest-3-8-0</link>
      <category>rspec</category>
      <category>autotest</category>
    </item>
  </channel>
</rss>
