<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ruby Flare</title>
	<atom:link href="http://rubyflare.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubyflare.com</link>
	<description></description>
	<lastBuildDate>Thu, 18 Apr 2013 11:54:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rubyflare.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ruby Flare</title>
		<link>http://rubyflare.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rubyflare.com/osd.xml" title="Ruby Flare" />
	<atom:link rel='hub' href='http://rubyflare.com/?pushpress=hub'/>
		<item>
		<title>Testing Scopes with Lambdas</title>
		<link>http://rubyflare.com/2012/02/24/testing-scopes-with-lambdas/</link>
		<comments>http://rubyflare.com/2012/02/24/testing-scopes-with-lambdas/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 04:50:12 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[scopes]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=274</guid>
		<description><![CDATA[How do you know that your scopes are correct? At work we had been plagued by mysterious multiple payments in one of our apps. It had been coded to prevent multiple payments yet some customers were somehow managing to do it. After a thorough investigation, I discovered that the problem simply came down to one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=274&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>How do you know that your scopes are correct? At work we had been plagued by mysterious multiple payments in one of our apps. It had been coded to prevent multiple payments yet some customers were somehow managing to do it. After a thorough investigation, I discovered that the problem simply came down to one of the scopes used in the code had been written incorrectly. Here it is:</p>
<p><code>scope :current, where('start_date &lt;= ?', Date.today).where('end_date &gt; ?', Date.today)</code></p>
<p>Do you see the problem? It is a scope that checks the object is current, that it has started but not yet ended. Unfortunately, this scope is missing a lambda.</p>
<p><code>scope :current, lambda { where('start_date &lt;= ?', Date.today).where('end_date &gt; ?', Date.today) }</code></p>
<p>Without the lambda, the scope is set to the date when the scope was first loaded so that Date.today remain static until the next deploy or when the production app is restarted. So it&#8217;ll work fine for a day and then it&#8217;ll start misbehaving. The lambda effectively defer the evaluation of the expression until it is needed. So each time you use Authorisation.current it&#8217;ll use the current date which is what you want.</p>
<p>So how do we avoid this mistake? Here&#8217;s the wrong way to test a scope that uses a lambda:</p>
<p><code>expired_auth = Authorisation.create(start_date: 4.days.ago, end_date: 2.days.ago)<br />
current_auth = Authorisation.create(start_date: 2.days.ago, end_date: 2.days.from_now)</p>
<p>Authorisation.current.should include(current_auth)<br />
Authorisation.current.should_not include(expired_auth)<br />
</code></p>
<p>This will pass the original non-lambda scope. It passes because it&#8217;s not really testing the dynamic nature of the scope provided by the lambda. For this I use the <a href="https://github.com/jtrupiano/timecop">Timecop gem</a>:</p>
<p><code>Timecop.freeze(Time.now)<br />
auth = Authorisation.create(start_date: 2.days.ago, end_date: 2.days.from_now)  # or use a factory to give you a current auth<br />
Authorisation.current.should include(auth)</p>
<p>Timecop.freeze(2.days)  # fast forward by 2 days so that the current auth is now by definition no longer current<br />
Authorisation.current.should_not include(auth)<br />
</code></p>
<p>Now this test fails with the non-lambda scope. When I change the scope to use lambda, the test now passes.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/274/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=274&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2012/02/24/testing-scopes-with-lambdas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Test Business Behaviour, Don&#8217;t Rely on UI</title>
		<link>http://rubyflare.com/2011/01/26/test-business-behaviour-dont-rely-on-ui/</link>
		<comments>http://rubyflare.com/2011/01/26/test-business-behaviour-dont-rely-on-ui/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 14:15:37 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[opinion]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=261</guid>
		<description><![CDATA[I often see Cucumber features written like this: It works and does the job but I feel that it isn&#8217;t enough. It&#8217;s fragile in several ways. First, if any of your form field or button labels change or your flash message changes, you&#8217;ll need to update your feature even though the behaviour hasn&#8217;t actually changed! [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=261&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I often see Cucumber features written like this:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Given I a have an account with email: &quot;user@test.com&quot; and password: &quot;password&quot;
When I go to the log in page
And I fill in &quot;Email&quot; with &quot;user@test.com&quot;
And I fill in &quot;Password&quot; with &quot;password&quot;
And I press &quot;Log in&quot;
Then I should see &quot;Logged in successfully.&quot;
And I should not see &quot;Log in&quot;
</pre>
<p>It works and does the job but I feel that it isn&#8217;t enough. It&#8217;s fragile in several ways.<br />
<span id="more-261"></span><br />
First, if any of your form field or button labels change or your flash message changes, you&#8217;ll need to update your feature even though the behaviour hasn&#8217;t actually changed! I totally understand why we write features like this &#8211; it&#8217;s convenient, it&#8217;s quick and easy.</p>
<p>Second, have we actually verified that the user has logged in? All we&#8217;ve really done is verify that we see a particular flash message and that we no longer see a piece of text on the page. We haven&#8217;t actually verified the behaviour under test here. Again, it&#8217;s convenience but it&#8217;s one that can cause you trouble.</p>
<p>I&#8217;ve had a feature like the above where the flash text I was looking for actually appeared in a login error message. For example:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Then I should see &quot;successfully logged in&quot;
</pre>
<p>My success flash message was &#8220;#{user.name} successfully logged in&#8221; and my feature passed. But it was a false positive. In fact the user had not successfully logged in at all. My error message was &#8220;#{user.name} was not successfully logged in&#8221; so when the login failed my step would still pass because the string is found on the page.</p>
<p>Okay, that&#8217;s easy to fix but it showed me just how easy it is for a feature to be fragile and too dependent on content and UI elements. Any rearrangement or inclusion of new content on a page can have a dramatic effect on your cucumber features. Worst case scenario is that you actually break functionality but your tests return a false positive.</p>
<p>To take it a step further, what if you had only implemented the flash handling and not the actual logging in of the user yet. You would get a passing feature.</p>
<p>My point is that the verification is not strong enough. You are reliant on an artefact of the logging in process. And this artefact is not part of the business rule.</p>
<p>The business rule here is that when a user logs in with the correct credentials they are successfully logged in. It is ancillary whether they see a flash message telling them they are logged in or if they can&#8217;t see the login button anymore. What you need to check is that the user is actually logged in.</p>
<p>So replace the last two lines in the example with:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Then I should be logged in
And I should be on the dashboard page
</pre>
<p>In your step definition you should use the logic that your system uses (or will use) to check if a user is logged in. For example:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Then /^I should be logged in$/ do
  # get your user first
  user.should be_logged_in
end</pre>
<p>To take it further, you can remove the other content and UI references to make your feature more robust:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Given I a have an account with email: &quot;user@test.com&quot; and password: &quot;password&quot;
When I go to the log in page
And I fill in the email field with &quot;user@test.com&quot;
And I fill in the password field with &quot;password&quot;
And I press the login button
Then I should be logged in
And I should be on the dashboard page
</pre>
<p>I admit that this is more work so, like most things, you need to decide what&#8217;s the most appropriate for your context. If nothing else, give some extra thought to your Then steps &#8211; are they thorough enough? are they verifying the primary business behaviour?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/261/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=261&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2011/01/26/test-business-behaviour-dont-rely-on-ui/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Faster Cucumbering With Pagination</title>
		<link>http://rubyflare.com/2010/11/25/faster-cucumbering-with-pagination/</link>
		<comments>http://rubyflare.com/2010/11/25/faster-cucumbering-with-pagination/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 06:30:50 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[pagination]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=247</guid>
		<description><![CDATA[When writing a cucumber feature that involves pagination, the easiest thing to do is to create the required number of objects to generate pagination. Given 31 tasks exist  # pagination defaults to 30 The downside of course is speed. Creating a large number of complex objects can add a lot of extra wait time to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=247&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>When writing a cucumber feature that involves pagination, the easiest thing to do is to create the required number of objects to generate pagination.</p>
<blockquote>
<pre>Given 31 tasks exist  # pagination defaults to 30</pre>
</blockquote>
<p>The downside of course is speed. Creating a large number of complex objects can add a lot of extra wait time to your cucumber runs. In my case, although I only had a few scenarios that involved pagination, my per_page setting was 50 and the objects I was creating were complex. The end result was a extra couple of (unnecessary) minutes. It wasn&#8217;t too bad so I left myself a TODO to fix it one day and that day finally came.<span id="more-247"></span></p>
<p>What I wanted to do was to simply change the default per_page setting for pagination across my entire project when running my cucumber suite so that I could rewrite my steps like this:</p>
<blockquote>
<pre>Given 3 tasks exist  # pagination defaults to 2</pre>
</blockquote>
<p>This is how I set it all up:</p>
<ul>
<li>DRYed up my code by pulling out explicit settings for the per_page option and setting a project-wide per_page setting for will_paginate as a constant in my environment.rb file</li>
<li>set a different value for this constant in my test.rb file and allow it to override the default setting above</li>
<li>modify my cucumber scenarios to use the new (smaller) per_page value</li>
</ul>
<p>More specifically, I added the following to the <strong>end</strong> of config/environment.rb:</p>
<pre>unless defined? DEFAULT_PER_PAGE
  # see: http://groups.google.com/group/will_paginate/browse_thread/thread/eda47114e3127709  
  ActiveRecord::Base.instance_eval do     
    def per_page; 50; end   
  end
  DEFAULT_PER_PAGE = ActiveRecord::Base.per_page
end</pre>
<p>Then in config/environments/test.rb:</p>
<pre>ActiveRecord::Base.instance_eval do     
  def per_page; 2; end   
end
DEFAULT_PER_PAGE = ActiveRecord::Base.per_page</pre>
<p>This solution was specific to my needs. In particular, I needed a DEFAULT_PER_PAGE constant within my code. This meant I could also use it as the conditional in my environment.rb to only set the override if it hadn&#8217;t already been set. One alternative was to take this code out of environment.rb and into the specific environment files eg development.rb, production.rb. But I also have a training.rb and a staging.rb so for me I preferred to put it into the generic environment file and change the setting specifically in the test environment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=247&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2010/11/25/faster-cucumbering-with-pagination/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript Testing with Cucumber, Capybara and env.js</title>
		<link>http://rubyflare.com/2010/06/12/javascript-testing-with-cucumber-capybara-and-env-js/</link>
		<comments>http://rubyflare.com/2010/06/12/javascript-testing-with-cucumber-capybara-and-env-js/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 22:05:35 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[capybara]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=238</guid>
		<description><![CDATA[Tim Riley was excited when he discoved capybara and wrote an excellent blog post about Javascript Testing with Cucumber and Capybara. I was excited too but it took until I was sitting in a hallway at railsconf recharging my laptop before I found the time to clone Tim&#8217;s demo app and give capybara a try. I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=238&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://openmonkey.com/">Tim Riley</a> was <a href="http://twitter.com/timriley/status/10967547994">excited</a> when he discoved c<a href="http://github.com/jnicklas/capybara">apybara</a> and wrote an excellent blog post about <a href="http://openmonkey.com/articles/2010/04/javascript-testing-with-cucumber-capybara">Javascript Testing with Cucumber and Capybara</a>. I was excited too but it took until I was sitting in a hallway at r<a href="http://en.oreilly.com/rails2010">ailsconf</a> recharging my laptop before I found the time to clone Tim&#8217;s demo app and give capybara a try. I was impressed! I ran the tests and Firefox opened up in the background, ran the test and closed almost in a blink of the eye. Wow, that was fast. So much faster than how I&#8217;ve previously tested my javascript with selenium and webrat. And no complicated setup or configuration.<span id="more-238"></span></p>
<p>Now, let me introduce you to capybara-envjs, a new gem that <a href="http://blog.josephwilk.net/">Joseph Wilk</a> described in his <a href="http://en.oreilly.com/rails2010/public/schedule/detail/14404">talk</a> at railsconf. It is a capybara driver for the envjs gem. Instead of using the selenium driver and launching a browser to perform the tests, it uses <a href="http://www.envjs.com/">envjs</a>, a simulated browser environment. That means it will be faster right? A quick experiment showed that it was. Another benefit is with running your javascript tests on a continuous integration server.</p>
<p>I&#8217;ve only just begun to play with this new setup but it looks promising. I&#8217;ve forked Tim&#8217;s original demo app and updated it to use capybara-envjs. To get it working, I added the following to cucumber&#8217;s env.rb file (in features/support):</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Capybara.javascript_driver = :envjs
</pre>
<p>And then I replaced the capybara gem in the Gemfile with:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
gem 'capybara-envjs', :require =&gt; 'capybara/envjs'
</pre>
<p>Easy! <a href="http://github.com/schlick/capybara-demo">Clone it and give capybara-envjs a try</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=238&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2010/06/12/javascript-testing-with-cucumber-capybara-and-env-js/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Cucumber Formatters</title>
		<link>http://rubyflare.com/2010/02/05/cucumber-formatters/</link>
		<comments>http://rubyflare.com/2010/02/05/cucumber-formatters/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 21:00:25 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[formatters]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=212</guid>
		<description><![CDATA[Cucumber allows you to format the results you get from running your features. With Cucumber 0.5, the Rails specific code was extracted out into a separate gem called cucumber-rails. With it came a smarter cucumber.yml file which now defaults to the &#8220;progress&#8221; format instead of &#8220;pretty&#8221;. This change prompted me to take a closer look [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=212&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://cukes.info/">Cucumber</a> allows you to format the results you get from running your features. With Cucumber 0.5, the Rails specific code was extracted out into a separate gem called cucumber-rails. With it came a smarter cucumber.yml file which now defaults to the &#8220;progress&#8221; format instead of &#8220;pretty&#8221;.</p>
<p><span id="more-212"></span>This change prompted me to take a closer look at the options available for formatting the output of running cucumber features. To see the full list enter in your console:</p>
<pre class="brush: plain; light: true; title: ; notranslate">cucumber --help</pre>
<p>To change the format pass either of the following:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
cucumber --format FORMAT
cucumber -f FORMAT
</pre>
<p>Here&#8217;s some of the format options:</p>
<ul>
<li><strong>html</strong> &#8211; Generates an HTML version of your test results which you can save as a file and view in a browser. This is the one to use when running Cucumber inside Textmate.</li>
<li><strong>pdf</strong> &#8211; Generates a fancy formatted pdf of your test results which you can share with your clients if you wish or for archiving in your company&#8217;s records management app.</li>
<li><strong>pretty</strong> &#8211; This was originally the default format. It prints out each step of a scenario and colours it according to whether it passed, failed, was undefined or was skipped. This format provides you with the most information and is the one to use when working the red-green-refactor cycle.</li>
<li><strong>progress</strong> &#8211; This is the new default. It prints a dot for each step that passed, an F for one that failed, a U for an undefined step, and a hyphen for a skipped step.</li>
<li><strong>rerun</strong> &#8211; Prints out the failing features (with line numbers). This is now used in the default &#8220;smart&#8221; cucumber profile to setup an automatic rerun of failed scenarios. When you first use cucumber, it runs all features and scenarios. If any fail, a rerun.txt will be created that contains the output from the rerun format, a list of failed scenarios. Now when you run cucumber again, it will only run the failed scenarios instead of your entire collection of features.</li>
<li><strong>tag_cloud</strong> &#8211; Useful for showing you what tags you have used and how often.</li>
<li><strong>usage</strong> &#8211; Useful for revealing which step definitions have not been used and which are the slowest.</li>
</ul>
<p>Finally, if none of these fit your needs, you can always <a href="http://wiki.github.com/aslakhellesoy/cucumber/custom-formatters">write your own</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=212&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2010/02/05/cucumber-formatters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Reasons, Not Excuses</title>
		<link>http://rubyflare.com/2009/12/31/reasons-not-excuses/</link>
		<comments>http://rubyflare.com/2009/12/31/reasons-not-excuses/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 07:00:55 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[opinion]]></category>

		<guid isPermaLink="false">http://rubyflare.wordpress.com/?p=86</guid>
		<description><![CDATA[Earlier this year a friend was considering going to Japan for a conference but he was saying things like &#8220;but I couldn&#8217;t&#8221; and &#8220;I can&#8217;t afford it&#8221;. He was talking himself out of it. I simply said, &#8220;focus on reasons not excuses&#8221;. Too often you are your own worst enemy. Don&#8217;t be a scrooge. Don&#8217;t be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=86&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Earlier this year a friend was considering going to Japan for a conference but he was saying things like &#8220;but I couldn&#8217;t&#8221; and &#8220;I can&#8217;t afford it&#8221;. He was talking himself out of it. I simply said, &#8220;focus on reasons not excuses&#8221;.<span id="more-86"></span></p>
<p>Too often you are your own worst enemy. Don&#8217;t be a scrooge. Don&#8217;t be a killjoy. When you find yourself deliberating over something, ignore your &#8220;excuses&#8221; and weigh up the reasons. The excuses are your immediate, negative knee-jerk reactions that have no substance. Identify the real reasons why you can and can&#8217;t do something. Make your decisions based on these instead.</p>
<p>Here are some common &#8220;excuses&#8221; and how you can turn them into reasons:</p>
<ul>
<li>&#8220;I can&#8217;t afford it&#8221; &#8211; ascertain the costs involved and check your bank balance. Can you borrow some money? Can you work extra hours to save up?</li>
<li>&#8220;I couldn&#8217;t possibly spend that much money on myself&#8221; &#8211; how much is too much? what&#8217;s your limit? will it be worth it?</li>
<li>&#8220;It&#8217;s probably sold out&#8221; &#8211; check it!</li>
<li>&#8220;My wife won&#8217;t let me&#8221; &#8211; don&#8217;t assume, ask your wife</li>
<li> &#8220;I won&#8217;t be able to get time off work&#8221; &#8211; ask your boss</li>
<li>&#8220;I&#8217;ll do it next year&#8221; &#8211; do you really think you&#8217;ll be in a better position next year? The opportunity may not exist next year.</li>
<li>&#8220;I can&#8217;t do it right now&#8221; &#8211; why not? really? is what you&#8217;re currently doing really more important?</li>
</ul>
<p>In the end, my friend went to RubyKaigi in Japan and had a ball! So, what&#8217;s your excuse?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=86&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2009/12/31/reasons-not-excuses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Pomodoro FTW!</title>
		<link>http://rubyflare.com/2009/12/29/pomodoro-ftw/</link>
		<comments>http://rubyflare.com/2009/12/29/pomodoro-ftw/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 21:00:48 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[time management]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=132</guid>
		<description><![CDATA[Do you pomodoro? It seems to be all the rage. It&#8217;s simple but effective, and I highly recommend it. The Pomodoro Technique is about focus and maintaining that focus. In a sentence, it is about focusing on a single task for 25 minutes straight, no interruptions. Can you do it? For a lot of people, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=132&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Do you pomodoro? It seems to be all the rage. It&#8217;s simple but effective, and I highly recommend it.</p>
<p><a href="http://www.pomodorotechnique.com/">The Pomodoro Technique</a> is about focus and maintaining that focus. In a sentence, it is about focusing on a single task for 25 minutes straight, no interruptions. Can you do it? For a lot of people, it is pretty hard. Email, twitter, facebook, SMS, and IM all compete for your attention and distract you from your work. People also like to procrastinate. When faced with a difficult task, you&#8217;d much rather do something easy and fun. It is common to leave essays and reports to the last minute.<span id="more-132"></span></p>
<p>In recent years, I&#8217;ve got better at focusing on tasks. Unfortunately, I had swung to the other extreme and I often went &#8220;dark&#8221;. I would turn everything off and lock myself away. I would quit email and ignore the phone. I also stopped taking breaks. I would eat food at my desk or skip lunch entirely. I would keep working late into the night. I wouldn&#8217;t stop until I was done.</p>
<p>Now I use the Pomodoro Technique and it has been a real boon for me. Not in terms of focusing; I can do that. Rather, it helped me to work sustainably. The simple idea of working solidly for 25 minutes and then taking a break works a treat. Having forced breaks at regular intervals keeps me fresh and allows me to keep working and performing at my best. My old style of working continuously without a break would quickly left me feeling tired. My productivity would drop and I would start making mistakes. My enthusiasm would also wane as I soldiered on valiantly, hour after hour. Instead, by breaking down my work into pomodoros (25 minute blocks of focused time), I find I&#8217;m actually more focused and more productive.</p>
<p>I use <a href="http://www.focusboosterapp.com/">Focus Booster</a> on the Mac to time my pomodoros. It is an Air app that is simple yet effective. Click the button and it starts counting down. It rings when your time is up and then starts your 5 minute break. When I&#8217;m at work I keep it on the screen for the benefit of my colleagues so they can see that I&#8217;m in a pomodoro. The epitome of its effectiveness was when my boss came over to interrupt me and my pairing partner. He saw the pomodoro, stopped, then said he&#8217;d come back in 15 (when the pomodoro had finished). Excellent!</p>
<p>There&#8217;s plenty of resources about the Pomodoro Technique. You can really get right into it, however, all you really need to know is this: focus on a single task for 25 minutes without interruptions or getting distracted then take a 5 minute break. You can change the length of a pomodoro if you wish but go with the 25/5 for starters. If you drink water during your pomodoro you&#8217;ll end up needing to go to the toilet every half an hour anyway.</p>
<p>Respect the pomodoro!</p>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="http://www.pomodorotechnique.com/resources/cirillo/ThePomodoroTechnique_v1-3.pdf">The Pomodoro Technique Online Book</a></li>
<li><a href="http://www.pomodorotechnique.com/downloads/pomodoro_cheat_sheet.pdf">The Pomodoro Technique Cheat Sheet</a></li>
<li><a href="http://pragprog.com/titles/snfocus/pomodoro-technique-illustrated">Pomodoro Technique Illustrated: The Easy Way to Do More in Less Time</a></li>
<li><a href="http://www.vimeo.com/4546375">Agile Pomodoro Development</a> (video presentation)</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=132&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2009/12/29/pomodoro-ftw/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Leave It In My In-Tray</title>
		<link>http://rubyflare.com/2009/12/01/leave-it-in-my-in-tray/</link>
		<comments>http://rubyflare.com/2009/12/01/leave-it-in-my-in-tray/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 21:16:54 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://rubyflare.wordpress.com/?p=173</guid>
		<description><![CDATA[When I first started working in &#8220;the enterprise&#8221; one of the first things I learnt was how to prioritise. I called it my in-tray method. It worked well but it isn&#8217;t something I advocate. In fact, if you find yourself using this method then it&#8217;s time to find another job! The in-tray method worked like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=173&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>When I first started working in &#8220;the enterprise&#8221; one of the first things I learnt was how to prioritise. I called it my in-tray method. It worked well but it isn&#8217;t something I advocate. In fact, if you find yourself using this method then it&#8217;s time to find another job!</p>
<p>The in-tray method worked like this: whenever someone came to give me new work I&#8217;d ask them to leave it in my in-tray. Then I would completely ignore it.  I would only deal with it if they came back for it. Most of the time they didn&#8217;t. Using this technique I could easily figure out what were the real priorities and simply forget the rest.</p>
<p><span id="more-173"></span>This worked because of the environment I found myself in. It was very reactive and the organisation lacked clear direction. We were trying to do too many things all at once and everything was a top priority. There was no one <a href="http://rubyflare.com/2009/09/09/push-back-say-no">pushing back and saying no</a>.</p>
<p>I happened upon this method by accident. Naturally, I was conscientious and I wanted to do a good job but things were hectic. By the time I finally got to the items in my in-tray I discovered that no one cared anymore. No one had followed up on them, they weren&#8217;t beating down my door or hounding me to get them done. These tasks obviously weren&#8217;t important so why should I waste my time on them!</p>
<p>Guaranteed, for the times when a task really did matter, people were very quick to follow up with a &#8220;have you finished [that task] yet?&#8221;. I would then quickly dig it out of my in-tray and get onto it straight away.</p>
<p>This technique worked well for me but I wouldn&#8217;t recommend it. Why? Because if you find yourself having to use it, then you are probably in a reactive and stressful workplace, fighting fires or spinning your wheels but never actually doing something concrete and useful. Doing lots of small and unimportant tasks is simply a waste of time. Your work should be organised and valuable. Your daily, weekly and monthly goals should be known in advance. Each day you should be working towards and contributing to the overall business plan and goals.</p>
<p>Of course there&#8217;ll always be unplanned tasks but these should be the exception, not the rule, and they should be critical to the business (emergencies like getting the phones working again in a call centre or re-enabling credit card processing in your online store). Everything else that can wait, should. You can be responsive without being reactive.</p>
<p>Now, I&#8217;ve talked about in-trays but of course you can substitute email inboxes here instead. It&#8217;s the same thing. Are you already practising this technique, perhaps unwittingly? Look in your inbox. Is it full of work requests that you haven&#8217;t responded to yet?</p>
<p>Finally, don&#8217;t confuse this with the <a href="http://www.jrank.org/business/pages/851/in-tray-exercise-(or-in-basket-exercise).html">in-tray assessment</a>. It&#8217;s a similar thing but my technique was to ignore all incoming tasks unless someone chased them up. The in-tray assessment is apparently a technique used by recruiters to gauge your ability to prioritise, handle interruptions and stressful situations. I say, if the job is like that, then I don&#8217;t want it. I believe it is much more efficient to focus on single tasks at a time that contribute to a clear goal. I&#8217;d rather do one task well than ten tasks poorly.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=173&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2009/12/01/leave-it-in-my-in-tray/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>Pickle Tables</title>
		<link>http://rubyflare.com/2009/11/26/pickle-tables/</link>
		<comments>http://rubyflare.com/2009/11/26/pickle-tables/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 13:12:35 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[pickle]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=169</guid>
		<description><![CDATA[Following on from my original and followup articles on using Pickle with Cucumber, a brand new version of Pickle is now available. Version 0.2.0 now gives you the ability to use Pickle with Cucumber&#8217;s multiline step argument tables. This means you can now do the following with Pickle: You can quickly create multiple objects in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=169&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Following on from my <a href="http://rubyflare.com/2009/10/28/pickle-my-cucumber/">original</a> and <a href="http://rubyflare.com/2009/11/03/more-pickle-action/">followup articles</a> on using Pickle with Cucumber, a brand new version of <a href="http://github.com/ianwhite/pickle">Pickle</a> is now available. Version 0.2.0 now gives you the ability to use Pickle with Cucumber&#8217;s <a href="http://wiki.github.com/aslakhellesoy/cucumber/multiline-step-arguments">multiline step argument tables</a>. This means you can now do the following with Pickle:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
Given a company exists
And another company: &quot;rubyflare&quot; exists
And the following people exist:
  | name  | age | employed | company              |
  | Digby | 13  | false    | the first company    |
  | Ethyl | 27  | true     | company: &quot;rubyflare&quot; |
Then the following people should exist:
  | name  | age |
  | Digby | 13  |
  | Ethyl | 27  |
And the 2nd person should be one of company: &quot;rubyflare&quot;'s employees
</pre>
<p>You can quickly create multiple objects in an easy to read fashion rather than filling your scenarios with multiple lines of &#8220;an another user exists &#8230;&#8221;. As an added bonus you can also use Pickle references within these tables. In the example above, we are creating new people objects and associating them to the companies using the Pickle references for these company objects.</p>
<p>Again, I&#8217;ll just point out that the above example required no custom step definitions. I didn&#8217;t have to write any step definitions! Pickle takes care of the grunt work leaving you free to focus on your domain specific scenario steps.</p>
<p>Other recent improvements with Pickle include:</p>
<ul>
<li>an email helper for mapping names to email addresses similar to paths</li>
<li>its own separate configuration file (pickle.rb) &#8211; pickle no longer adds code to features/support/env.rb</li>
</ul>
<p>I&#8217;ve also updated my <a href="http://github.com/schlick/pickle_example">pickle_example project</a> to the latest version and have added the above example scenario. Feel free to clone it and use it to explore the benefits of using Pickle.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/169/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=169&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2009/11/26/pickle-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
		<item>
		<title>More Pickle Action</title>
		<link>http://rubyflare.com/2009/11/03/more-pickle-action/</link>
		<comments>http://rubyflare.com/2009/11/03/more-pickle-action/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 21:00:11 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[pickle]]></category>

		<guid isPermaLink="false">http://rubyflare.com/?p=155</guid>
		<description><![CDATA[In a previous blogpost I championed the benefits of using Pickle with Cucumber to speed up your BDD. Recently, I was able to contribute back to Pickle in a small way with the following two changes: you can now use negative numbers in numeric field values when creating objects, and you can use some extra [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=155&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In a <a href="http://rubyflare.com/2009/10/28/pickle-my-cucumber/">previous blogpost </a>I championed the benefits of using <a href="http://github.com/ianwhite/pickle">Pickle</a> with <a href="http://wiki.github.com/aslakhellesoy/cucumber">Cucumber</a> to speed up your BDD. Recently, I was able to contribute back to Pickle in a small way with the following two changes:</p>
<ul>
<li>you can now use <a href="http://github.com/ianwhite/pickle/commit/09521f588440efc5310ac9a208995eb51c366559">negative numbers in numeric field values</a> when creating objects, and</li>
<li>you can use some <a href="http://github.com/ianwhite/pickle/commit/3c01d71d40997fb68ce9853e2abbab5d9d45433c">extra default step definitions</a> to verify the non-existence of objects</li>
</ul>
<p>This means you can do things like this in your plain text cucumber steps:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Given a user exists with name: &quot;Digby&quot;, bank_balance: -43.25
</pre>
<p>And if you need to, you can also be explicit with the positive sign:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
And another user exists with name: &quot;Miranda&quot;, bank_balance: +86.50
</pre>
<p>The extra step definitions allow you to do the following:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Then a user should not exist with name: &quot;Maya&quot;
And the first user should not be one of the last user's debtors
And the last user should not be the first user's creditor
</pre>
<p>These are the &#8220;not&#8221; versions of some of the existing default step definitions. I found that I was needing these in my Rails projects and thought they would be good to have in the standard Pickle. Ian White, the creator of Pickle, agreed.</p>
<p>It feels good to contribute back to an open source project, even in a small way, and I encourage you all to try to do so as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyflare.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyflare.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyflare.com&#038;blog=8540151&#038;post=155&#038;subd=rubyflare&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyflare.com/2009/11/03/more-pickle-action/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf4fe97f61701a3f2fe96a29223fa35?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">schlick</media:title>
		</media:content>
	</item>
	</channel>
</rss>
