<?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>has_many :thoughts: Tag bdd</title>
    <link>http://blog.kineticweb.com/articles/tag/bdd</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>Philly on Rails RSpec Presentation</title>
      <description>&lt;p&gt;Last night, I presented about RSpec to the Philly on Rails user group. It was a fun time. Seemed to go well; I hope people found it informative.&lt;/p&gt;


	&lt;p&gt;It was such a great idea to agree to present on it because a couple months ago I had barely used it. Agreeing to speak in front of a few people about it forced me to learn it. And, so far, I love RSpec!&lt;/p&gt;


	&lt;p&gt;Here are &lt;a href="http://blog.kineticweb.com/files/rspec"&gt;my slides&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;I wanted to create &lt;span class="caps"&gt;XHTML&lt;/span&gt; ones but didn&amp;#8217;t have time to learn how and just used Keynote. So they&amp;#8217;re just big JPEGs. And they&amp;#8217;re really not that useful unless you were there last night. I tended to use a lot of illustrations that won&amp;#8217;t mean much unless someone is chatting along side them.&lt;/p&gt;


	&lt;p&gt;I will try and post up a few more posts about RSpec in the coming days to supplement the slides.&lt;/p&gt;</description>
      <pubDate>Thu, 13 Sep 2007 07:48:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:5eb965e6-c0f9-4fba-b6bd-a8d20de87985</guid>
      <author>Colin A. Bartlett</author>
      <link>http://blog.kineticweb.com/articles/2007/09/13/philly-on-rails-rspec-presentation</link>
      <category>rspec</category>
      <category>bdd</category>
      <category>Rails</category>
      <trackback:ping>http://blog.kineticweb.com/articles/trackback/57</trackback:ping>
    </item>
    <item>
      <title>Start Specin' the News</title>
      <description>&lt;p&gt;Since Colin came back from RailsConf raving about &lt;span class="caps"&gt;BDD&lt;/span&gt;, I&amp;#8217;ve found myself priming up for what previously seemed inevitable. Behavioral testing as part of a new development process. Through a better testing structure I hope to..&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;better the quality of my code&lt;/li&gt;
		&lt;li&gt;refined organization of development time&lt;/li&gt;
		&lt;li&gt;focus on the task at hand&lt;/li&gt;
		&lt;li&gt;providing well covered documentation&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;With that said&amp;#8230; and being the &lt;span class="caps"&gt;HUGE&lt;/span&gt; social loser I am&amp;#8230; I&amp;#8217;ve spent the last two days writing Specs and tests using RSpec 1.0. I have to say its almost too easy writing the actual tests, whereas the process of writing some tests, writing the code and making the code pass the test has been a definite shift in the way I develop. But not an unwelcomed one! ;)&lt;/p&gt;


	&lt;p&gt;Since RSpec seems to have a real lack of helpful documentation, I find myself wondering around their &lt;span class="caps"&gt;API&lt;/span&gt;, blog posts and best guesses. I have had great success so far, until I started writing some protected/private methods.&lt;/p&gt;


	&lt;p&gt;I had initially forseen a world of testing every single line and expression of code. Until I found this tidbit of info on the rspec mailing list&amp;#8230;&lt;/p&gt;


&lt;blockquote&gt;
1.  Should you test protected and private methods in your specs?
&lt;br /&gt;&lt;br /&gt;
No. You&amp;#8217;re specifying the behavior of an object as seen by the outside world. Of course protected and private methods aren&amp;#8217;t available to the world, so why would you need to test them? When
you&amp;#8217;re doing state-based testing, just call a method and then verify that it returns the expected value or leaves your object in an expected state.
&lt;/blockquote&gt;

	&lt;p&gt;This was backed up by almost every post after it. Seems that as a developer testing his code, I should stick with testing the main parts of the system that, overall, accomplish my task. Verifying that they are doing what I need them to do.&lt;/p&gt;


	&lt;p&gt;Private and protected methods typically back up other parts of the system that are public. For documentation purposes, I will probably write some tests that validate the functionality of a private/protected method IF they are made public. Just keeping them commented out to satisfy my entire spec.&lt;/p&gt;


	&lt;p&gt;&lt;small&gt;&lt;a href="http://rubyforge.org/pipermail/rspec-users/2007-March/001019.html"&gt;Quoted RSpec mailing list post&lt;/a&gt; and &lt;a href="http://rubyforge.org/pipermail/rspec-users/2007-March/001012.html"&gt;another great post after that&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 27 May 2007 12:57:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:fd1381b7-c3f3-4928-ad3e-73db16593f0e</guid>
      <author>Justin Reagor</author>
      <link>http://blog.kineticweb.com/articles/2007/05/27/start-specin-the-news</link>
      <category>rspec</category>
      <category>Rails</category>
      <category>bdd</category>
    </item>
  </channel>
</rss>
