<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>shoulda &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/shoulda/</link>
	<description>Feed of posts on WordPress.com tagged "shoulda"</description>
	<pubDate>Tue, 01 Dec 2009 02:05:38 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Double Shot #545]]></title>
<link>http://afreshcup.com/2009/09/22/double-shot-545/</link>
<pubDate>Tue, 22 Sep 2009 09:44:22 +0000</pubDate>
<dc:creator>Mike Gunderloy</dc:creator>
<guid>http://afreshcup.com/2009/09/22/double-shot-545/</guid>
<description><![CDATA[If small children are going to wake me up early, I might as well post links. Refinery &#8211; Anothe]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If small children are going to wake me up early, I might as well post links.</p>
<ul>
<li><strong><a href="http://github.com/resolve/Refinery">Refinery</a></strong> &#8211; Another entry in the Rails CMS sweepstakes.</li>
<li><strong><a href="http://m.onkey.org/2009/9/20/make-your-shoulda-tests-faster-with-fast_context">Make your shoulda tests faster with fast_context</a></strong> &#8211; Pratik offers a technique for speeding up shoulda if your setups are bulky.</li>
<li><strong><a href="http://mbleigh.com/2009/09/21/couchdb-lucene-couchdbx-and-couchrest.html">CouchDB-Lucene, CouchDBX, and CouchRest</a></strong> &#8211; Not my cup of tea but perhaps yours. </li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Before there was Surf 'n' Turf]]></title>
<link>http://pageslap.wordpress.com/2009/08/04/before-there-was-surf-n-turf/</link>
<pubDate>Tue, 04 Aug 2009 07:32:11 +0000</pubDate>
<dc:creator>stamp</dc:creator>
<guid>http://pageslap.wordpress.com/2009/08/04/before-there-was-surf-n-turf/</guid>
<description><![CDATA[Scooter and I stuffed our craws with a delicious medley of lobster &#8216;n&#8217; sirloin last nigh]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://pageslap.wordpress.com/files/2009/08/22751-bigthumbnail.jpg"><img src="http://pageslap.wordpress.com/files/2009/08/22751-bigthumbnail.jpg" alt="22751-bigthumbnail" title="22751-bigthumbnail" width="430" height="360" class="aligncenter size-full wp-image-3216" /></a></p>
<p>Scooter and I stuffed our craws with a delicious medley of <a href="http://en.wikipedia.org/wiki/Surf_and_turf">lobster &#8216;n&#8217; sirloin</a> last night, which got me thinking.  Surf &#8216;n&#8217; Turf is a catchy menu item and all, but what else did that enterprising restauranteur cross off the list before he coined the phrase (on a napkin, no doubt) back in 1967?  Why didn&#8217;t he go with:</p>
<p>hay &#8216;n&#8217; bay<br />
cowbell &#8216;n&#8217; shell<br />
straw &#8216;n&#8217; claw<br />
pet &#8216;n&#8217; wet<br />
bovine &#8216;n&#8217; brine<br />
calf &#8216;n&#8217; bath<br />
steak &#8216;n&#8217; lake<br />
Bessie &#8216;n&#8217; the sea<br />
cultivated land &#8216;n&#8217; sand<br />
oxtail &#8216;n&#8217; shrimp cocktail<br />
rumination &#8216;n&#8217; crustacean<br />
beef &#8216;n&#8217; reef<br />
grill &#8216;n&#8217; krill<br />
cud &#8216;n&#8217; mud</p>
<p>I&#8217;m just saying.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[JRuby Testing for Fun and Profit]]></title>
<link>http://jrubyist.wordpress.com/2009/07/12/jruby-testing-shoulda-test-unit/</link>
<pubDate>Sun, 12 Jul 2009 16:50:52 +0000</pubDate>
<dc:creator>jrubyist</dc:creator>
<guid>http://jrubyist.wordpress.com/2009/07/12/jruby-testing-shoulda-test-unit/</guid>
<description><![CDATA[If your place of employment is still considering whether to allow languages besides Java and C++ in-]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If your place of employment is still considering whether to allow languages besides Java and C++ in-house, I believe the area of unit testing can be a great place to start experimenting and having fun.   JRuby in particular is a great way to blend the scalability of the JVM with the concise expressiveness of Ruby.  If you want to try it out in a test environment before writing a full blown application in JRuby on Rails, for example,  I&#8217;ll be discussing some JRuby test tools that you can use to boost your TDD experience.  Perhaps your boss will come to appreciate the readability of the code and encourage more use of JRuby in the future.</p>
<p>In my last post, I mentioned how you can *measure* the quality of your code.  That is a great technique for finding specific trouble spots in your code; you might have duplicated code, you might have an over-complicated algorithm, or you could simply perform the same task with fewer branches and fewer lines of code with a new design.</p>
<p>After you take the time to generate these metrics, you need to be able to make use of the data.  Some people get defensive about what the metrics might say about their code.  This is a common reaction among junior software developers.  I have noticed that people tend to warm up to constructive criticism with more experience.  The only way to improve your understanding of programming and to develop yourself as a professional is to understand what you are doing wrong, and then take steps to improve those areas.</p>
<p>Think of these metrics as a set of huge neon arrows pointing at some of the most problematic areas of your code base.  Perhaps you as an individual understand some really clever technique in your code, but imagine if you needed to explain it in a code review or make changes to it 6 or 9 months from now.  Would you really still understand it?  Could it be written better?  Are the code metrics knocking on your door to ask you to revise it?  If so, it is a good idea to make sure you don&#8217;t break anything else when trying to improve that part of the code.</p>
<p>If you and your team have adopted TDD or BDD and have stuck to it on your greenfield project, then you are in great shape.  You have some benchmarks in place to measure processing time, you may have clearly defined requirements, and you know when one of your acceptance tests will fail.  You probably have a huge set of tests, with 80% code coverage.  That&#8217;s how the world would work if it was perfect&#8230;. Wait, this doesn&#8217;t match your situation?  Unfortunately, this is another point at which teams get defensive.  &#8220;There wasn&#8217;t enough time when we started the project.&#8221;  &#8220;TDD is unrealistic and too dogmatic.  I&#8217;m more _agile_ and I need to be able to change my code quickly.&#8221;  (Have you ever noticed the word &#8220;agile&#8221; is often used incorrectly, and has become a buzz word?)  To truly be agile, you need to both be able to change your code to adapt to new requirements or make optimizations, and at the same time ensure you are not introducing a new bug in the process.</p>
<p>Whether you and your team are in the first camp (continuous integration with critical code covered) or in the second camp (no tests, just &#8220;production&#8221; testing)&#8230; or somewhere in-between, there are some great tools available to you to improve your testing experience.</p>
<p><strong>Test::Unit</strong><br />
The <em>x</em>Unit tool had its beginnings with Smalltalk, and seems to be the most ubiquitous testing tool across developers from different generations and languages.  It involves creating a set of test suites consisting of test cases.  Each test case is a large set of methods beginning with <em>test_</em>, and each test method is supposed to focus on a particular aspect of your code.  Here is an example that tests an instance of an Amounts class.  The amounts instance acts as an accumulator that can be queried for average &#8220;win&#8221; (positive) values, &#8220;loss&#8221; (negative) values and total</p>
<pre>require 'test/unit'

class AmountsTest &#60; Test::Unit::TestCase
  def setup
     @amounts = Amounts.new
  end

  def test_something
     @amounts.clear
     assert_equal( 0, @amounts.total )
     assert_equal( 0, @amounts.average_win )
     assert_equal( 0, @amounts.average_loss )
     assert_equal( 0, @amounts.average )
     assert_equal( 0, @amounts.average { &#124;value&#124; value % 2 == 0 } )
  end

  def test_with_one_negative_amount
     @amounts.clear
     @amounts.add( -5 )
     # perform more assertions...
  end

   def test_with_one_positive_amount
     @amounts.clear
     @amounts.add( 2 )
     # perform more assertions...
   end

   def test_with_multiple_positive_amounts
     @amounts.clear
     @amounts.add( 3 )
     @amounts.add( 2 )
     # perform more assersions...
   end

   def test_with_multiple_negative_amounts
     @amounts.clear
     @amounts.add( -7 )
     @amounts.add( -2 )
     # perform more assersions...
   end

   def test_with_multiple_mixed_posistive_and_negative_amounts
     @amounts.clear
     @amounts.add( -8 )
     @amounts.add( 5 )
     @amounts.add( 2 )
     @amounts.add( -1 )
     @amounts.add( 13 )
     # perform more assertions
   end

   # this is beginning to get tedious...
end</pre>
<p>Every test method is able to share a tiny <em>setup</em> method, but each test must make sure it is working with an empty version of itself by clearing out the instance before setting up some data in the instance it is testing with.  This almost makes the initial setup method useless, as it would be just as easy to simply recreate the instance every time.  Also note how it begins to get fairly tedious to write code to clear out the instance and add more values to the @amounts object in each test.  You could write helper methods to set up your data, but then you run the risk of losing connascence of location, and the test data could become too separated from the test itself.  </p>
<p>Another thing that is lacking is the elegance of a DSL for testing.   All these steps involved in setting up an object and running static-like assertions against results.  It does the job of testing for accuracy, but this solution doesn&#8217;t really do a great job of telling the user of the API (or just yourself 6 months down the road) why it behaves the way it does.  If you agree, you are not alone.  Many other developers have noticed this shortfall and have longed for something better.</p>
<p>Along came <strong>RSpec</strong>, a gem that allows Ruby/JRuby developers to use a DSL for describing examples of the expected behavior of the domain object. You can get started with it by
<pre>gem install spec</pre>
<p>.  The <a href="http://rspec.info/documentation/">documentation</a> for RSpec includes a basic example of a scenario between you and a customer, and how that could be translated into a DSL based test with RSpec:</p>
<p>#You:          Describe an account when it is first created.<br />
#Customer: It should have a balance of $0.</p>
<pre>
describe Account, "when first created" do
  before(:all) do
      @account = Account.new(:balance=&#62;0)
  end

  before(:each) do
      @account.balance = 0
  end

  it "should have a balance of $0" do
     @account.balance.should == 0
  end

  # ...
end
</pre>
<p>RSpec also introduces what appears to be its own syntax to testing, which is sort of a controversial concept in the testing.  Do you really want to confuse other developers by using an unfamiliar set of test functions, when they already have enough to worry about when they are trying to learn <em>your</em> codebase?</p>
<p>When RSpec sees &#8216;be_&#8217; in a matcher (after &#8217;should&#8217;), it looks for a method with a name that follows &#8216;be_&#8217; and has a &#8216;?&#8217; at the end. In this case &#8216;be_lower_case&#8217; makes RSpec look for a method called &#8216;lower_case?&#8217; and calls it.  That is clever, but I actually find that syntactic sugar to be a little distracting.  By using clever tricks like this, it can make your tests read more like human language, but ask yourself this:  Do you want to test your API, or do you want to test the code that is testing your code?  When your test breaks as a result of a code change, it is better to spend time on testing the code and not worrying that it might be that your test is the &#8216;thing&#8217; that is broken.</p>
<p>Don&#8217;t get me wrong; RSpec is a great tool and gets us closer to BDD, but I think it tries to go one step too far with the matchers.  Domain experts don&#8217;t speak in &#8216;plain english&#8217;, like the purist BDD evangelists would like.  As <a href="http://pragdave.blogs.pragprog.com/pragdave/2008/03/the-language-in.html">PragDave explained, they speak jargon,</a> a specialized set of vocabulary used by industry experts to communicate in whatever language they know.  It seems a bit strange to attempt writing tests in almost_but_not_quite_english directly_in the(code).  It makes me think too much about the language of testing rather than the code I am testing.</p>
<p>So is there a happy medium?  I think that there is.  On my quest to find a great set of tools for testing, I came across Thoughtbot&#8217;s <strong>Shoulda</strong>.  Forgetting about some of the nice helper methods for integrating with Rails and ActiveRecord, I simply wanted to use Shoulda for creating extremely readable (and easily writable) unit tests in a DSL style format.  <a href="http://thoughtbot.com/projects/shoulda/">Shoulda consists of test macros, assertions, and helpers added on to the Test::Unit framework. It‘s fully compatible with your existing tests, and requires no retooling to use</a>.</p>
<pre>sudo gem install thoughtbot-shoulda --source=http://gems.github.com</pre>
<p>One of the really cool (and highly pragmatic) features of Shoulda is its use of <strong>nested</strong> contexts.  To quote <a href="http://pragdave.blogs.pragprog.com/pragdave/2008/04/shoulda-used-th.html">(Prag)Dave Thomas</a>, &#8220;the outer setup gets run before the execution of each of the inner contexts. And the setup in the inner contexts gets run when running that context. And shoulda keeps track of it all, so I get very natural error messages if an assertion fails.&#8221;</p>
<pre>
class UserTest &#60; Test::Unit::TestCase
    context &#34;A User instance&#34; do
      setup do
        @user = User.find(:first)
      end

      should &#34;return its full name&#34; do
        assert_equal &#39;John Doe&#39;, @user.full_name
      end

      context &#34;with a profile&#34; do
        setup do
          @user.profile = Profile.find(:first)
        end

        should &#34;return true when sent #has_profile?&#34; do
          assert @user.has_profile?
        end
      end
    end
  end
</pre>
<p>Produces the following test methods:</p>
<p>  &#8220;test: A User instance should return its full name.&#8221;<br />
  &#8220;test: A User instance with a profile should return true when sent #has_profile?.&#8221;</p>
<p>The example above was ripped right off from the Shoulda website for a quick, clear example of what is going on.  I thought Shoulda&#8217;s readability and simplicity just blended well with how my mind works, but really, the choice is yours.  I think the fact that it also blends seamlessly with test/unit is a huge plus.  You can combine it with regular test cases if you&#8217;d like (but why would you, other than to be backwards compatible?).</p>
<p><strong>Conclusion</strong><br />
In the end, what seems to work really well for me and my team is a best-of-all-worlds approach.  Test/Unit is a very recognizable test framework that developers with diverse language backgrounds are all familiar with, so it seems like a natural starting point.  Plenty of tools are available to automate the running of those tests in a continuous integration environment and visually reporting the results of passed/failed tests in an automated way.  I should note that RSpec also has ways of hooking up into automated tools, but it does require a (very small) additional step, usually a Rake task to hook into.</p>
<p>I love the way Shoulda works seamlessly with test/unit, and makes test cases more readable and understandable.  A killer feature of Shoulda is the concept of nested contexts, which keeps your tests extremely DRY, and allows you to read the contexts almost as if they were full sentences that describe an entire use case of your application.<br />
Finally, I really like having the ability to use the &#8220;should&#8221; method from RSpec, but only in a way that keeps the test code extremely readable (and writable).  In the end, whatever frameworks and libraries you choose to use (and choose not to use) will help you improve your code style, your coding accuracy, and your ability to communicate the intention of your code among other individuals.</p>
<p>Remember, every test you spend time writing today will save you time in the future.  Each test you write is like a little guardian, protecting you from mistakes made by others, and even mistakes made by yourself.  The initial work is definitely worth the effort involved.  If you are looking to gain respect from your peers in your profession, you owe it to yourself and those around you to treat your profession with respect and hone your craft by your pursuit of continuous improvement of your code and of yourself.</p>
<p><strong>Full Example Mixing Test/Unit, RSpec and Shoulda</strong></p>
<pre>
class AmountsTest &#60; Test::Unit::TestCase
  # instance_methods &#34;&#60;&#60;&#34;, &#34;average&#34;, &#34;average_loss&#34;, &#34;average_win&#34;, &#34;description&#34;, &#34;size&#34;, &#34;success_rate&#34;, &#34;total&#34;
  context &#34;An Amounts instance&#34; do
    setup do
      @description = &#34;B&#34;
      @amounts = Prices::Amounts.new(@description)
    end

    should &#34;describe itself&#34; do
      @amounts.description.should == @description
    end

    should &#34;have a total of 0 when first created.&#34; do
      @amounts.total.should == 0
    end

    should &#34;have a size of 0 when first created.&#34; do
      @amounts.size.should == 0
    end

    context &#34; after adding an amount that is positive &#34; do
      setup do
        @single_amount = 4
        @amounts &#60;&#60; @single_amount
      end

      should &#34; have a total equal to the single amount.&#34; do
        @amounts.total.should == @single_amount
      end

      should &#34; have an average win equal to the single amount.&#34; do
        @amounts.average_win.should == @single_amount
      end

      should &#34; have an average loss equal to 0.&#34; do
        @amounts.average_loss.should == 0
      end

      should &#34; have a success rate of 100% &#34; do
        @amounts.success_rate == 100
      end

      should &#34;have a size of 1.&#34; do
        @amounts.size.should == 1
      end

      should &#34;have a total of single_amount.&#34; do
        @amounts.total.should == @single_amount
      end

      context &#34; and adding another amount that is negative &#34; do
        setup do
          @another_amount = -3
          @amounts &#60;&#60; @another_amount
        end

        should &#34; not have a total equal to the other amount. &#34; do
          @amounts.total.should_not == @another_amount
        end

        should &#34; have a total equal to the single_amount and another_amount. &#34; do
          @amounts.total.should == (@single_amount + @another_amount)
        end

        should &#34; have an average_win of the first single_amount &#34; do
          @amounts.average_win.should == @single_amount
        end

        should &#34; have an average_loss of another_amount &#34; do
          @amounts.average_loss.should == @another_amount
        end

        should &#34; have a success rate of 50%&#34; do
          @amounts.success_rate.should == 50
        end

        should &#34; have an average( any_not_nil ) of (single_amount + another_amount)/2.0&#34; do
          @amounts.average { &#124;any_not_nil&#124; any_not_nil}.should ==
                                        ( (@single_amount + @another_amount) / 2.0 )
        end

        should &#34;have a size of 2.&#34; do
          @amounts.size.should == 2
        end

      end
    end
  end
end
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to Add Simple Permissions into Your Simple App]]></title>
<link>http://thailehuy.wordpress.com/2009/05/20/how-to-add-simple-permissions-into-your-simple-app/</link>
<pubDate>Wed, 20 May 2009 04:55:08 +0000</pubDate>
<dc:creator>thailehuy</dc:creator>
<guid>http://thailehuy.wordpress.com/2009/05/20/how-to-add-simple-permissions-into-your-simple-app/</guid>
<description><![CDATA[Source: http://railstips.org/2009/4/20/how-to-add-simple-permissions-into-your-simple-app-also-thoug]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Source: <a href="http://railstips.org/2009/4/20/how-to-add-simple-permissions-into-your-simple-app-also-thoughtbot-rules" target="_blank">http://railstips.org/2009/4/20/how-to-add-simple-permissions-into-your-simple-app-also-thoughtbot-rules</a></p>
<div class="body">
<p>Last week, in a few hours, I whipped together <a href="http://flightcontrolled.com/">flightcontrolled.com</a> for Flight Control, a super fun iPhone game. The site allows users to upload screenshots of their high scores. I thought I would provide a few details here as some may find it interesting.</p>
<p>It is a pretty straightforward and simple site, but it did need a few permissions. I wanted users to be able to update their own profile, scores and photos, but not anyone else’s. On top of that, I, as an admin, should be able to update anything on the site. I’m sure there is a better way, but this is what I did and it is working just fine.</p>
<h2>Add admin to users</h2>
<p>I added an admin boolean to the users table. You may or may not know this, but Active Record adds handy boolean methods for all your columns. For example, if the user model has an email column and an admin column, you can do the following.</p>
<pre><code class="ruby">user = User.new
user.email? <span class="comment"># =&#62; false</span>
user.email = <span class="string">'foobar@foobar.com'</span>
user.email? <span class="comment"># =&#62; true</span>

user.admin? <span class="comment"># =&#62; false</span>
user.admin = true
user.admin? <span class="comment"># =&#62; true</span></code></pre>
<h2>Simple permissions module</h2>
<p>Next up, I created a module called permissions, that looks something like this:</p>
<pre><code class="ruby"><span class="keywords">module</span> Permissions
  <span class="keywords">def</span> changeable_by?<span class="brackets">(</span>other_user<span class="brackets">)</span>
    return false <span class="keywords">if</span> other_user.nil?
    user == other_user &#124;&#124; other_user.admin?
  <span class="keywords">end</span>
<span class="keywords">end</span></code></pre>
<p>I put this in app/concerns/ and added that directory to the load path, but it will work just fine in lib/.</p>
<h2>Mixin the permission module</h2>
<p>Then in the user, score and photo models, I just include that permission module.</p>
<pre><code class="ruby"><span class="keywords">class</span> Score &#60; ActiveRecord::Base
  include Permissions
<span class="keywords">end</span>

<span class="keywords">class</span> Photo &#60; ActiveRecord::Base
  include Permissions
<span class="keywords">end</span>

<span class="keywords">class</span> User &#60; ActiveRecord::Base
  include Permissions
<span class="keywords">end</span></code></pre>
<h2>Add checks in controllers/views</h2>
<p>Now, in the view I can check if a user has permission before showing the edit and delete links.</p>
<pre><code class="erb"><span class="tag">&#60;%</span>- <span class="keywords">if</span> score<span class="method">.changeable_by?</span><span class="brackets">(</span>current_user<span class="brackets">)</span> -<span class="tag">%&#62;</span>
  &#60;li <span class="keywords">class</span>=<span class="string">"actions"</span>&#62;
    <span class="tag">&#60;%=</span> link_to <span class="string">'Edit'</span>, edit_score_url<span class="brackets">(</span>score<span class="brackets">)</span> <span class="tag">%&#62;</span>
    <span class="tag">&#60;%=</span> link_to <span class="string">'Delete'</span>, score, <span class="symbol">:method</span> =&#62; <span class="symbol">:delete</span> <span class="tag">%&#62;</span>
  &#60;/li&#62;
<span class="tag">&#60;%</span>- <span class="keywords">end</span> -<span class="tag">%&#62;</span></code></pre>
<p>And in the controller, I can do the same.</p>
<pre><code class="ruby"><span class="keywords">class</span> ScoresController &#60; ApplicationController
  before_filter<span class="symbol"> :authorize</span>,<span class="symbol"> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly</span> =&#62; <span class="symbol">[:edit</span>,<span class="symbol"> :update</span>,<span class="symbol"> :destroy</span>]

  private
    <span class="keywords">def</span> authorize
      <span class="keywords">unless</span> @score.changeable_by?<span class="brackets">(</span>current_user<span class="brackets">)</span>
        render<span class="symbol"> :text</span> =&#62; <span class="string">'Unauthorized'</span>,<span class="symbol"> :status</span> =&#62;<span class="symbol"> :unauthorized</span>
      <span class="keywords">end</span>
    <span class="keywords">end</span>
<span class="keywords">end</span></code></pre>
<h2>Macro for model tests</h2>
<p>I didn’t forget about testing either. I created a quick macro for <a href="http://railstips.org/2009/2/21/shoulda-looked-at-it-sooner">shoulda</a> like this (also uses factory girl and <a href="http://railstips.org/2009/3/24/custom-matchers-for-matchy">matchy</a>):</p>
<pre><code class="ruby"><span class="keywords">class</span> ActiveSupport::TestCase
  <span class="keywords">def</span> <span class="keywords">self</span>.should_have_permissions<span class="brackets">(</span>factory<span class="brackets">)</span>
    should <span class="string">"know who has permission to change it"</span> <span class="keywords">do</span>
      object     = Factory<span class="brackets">(</span>factory<span class="brackets">)</span>
      admin      = Factory<span class="brackets">(</span>:admin<span class="brackets">)</span>
      other_user = Factory<span class="brackets">(</span>:user<span class="brackets">)</span>
      object.changeable_by?<span class="brackets">(</span>other_user<span class="brackets">)</span>.should be<span class="brackets">(</span>false<span class="brackets">)</span>
      object.changeable_by?<span class="brackets">(</span>object.user<span class="brackets">)</span>.should be<span class="brackets">(</span>true<span class="brackets">)</span>
      object.changeable_by?<span class="brackets">(</span>admin<span class="brackets">)</span>.should be<span class="brackets">(</span>true<span class="brackets">)</span>
      object.changeable_by?<span class="brackets">(</span>nil<span class="brackets">)</span>.should be<span class="brackets">(</span>false<span class="brackets">)</span>
    <span class="keywords">end</span>
  <span class="keywords">end</span>
<span class="keywords">end</span></code></pre>
<p>Which I can then call from my various model tests:</p>
<pre><code class="ruby"><span class="keywords">class</span> ScoreTest &#60; ActiveSupport::TestCase
  should_have_permissions<span class="symbol"> :score</span>
<span class="keywords">end</span></code></pre>
<p>Looking at it now, I probably could just infer the score factory as I’m in the ScoreTest, but for whatever reason, I didn’t go that far.</p>
<h2>A sprinkle of controller tests</h2>
<p>I also did something like the following to test the controllers:</p>
<pre><code class="ruby"><span class="keywords">class</span> ScoresControllerTest &#60; ActionController::TestCase
  context <span class="string">"A regular user"</span> <span class="keywords">do</span>
    setup <span class="keywords">do</span>
      @user = Factory<span class="brackets">(</span>:email_confirmed_user<span class="brackets">)</span>
      sign_in_as @user
    <span class="keywords">end</span>

    context <span class="string">"on GET to :edit"</span> <span class="keywords">do</span>
      context <span class="string">"for own score"</span> <span class="keywords">do</span>
        setup <span class="keywords">do</span>
          @score = Factory<span class="brackets">(</span>:score,<span class="symbol"> :user</span> =&#62; @user<span class="brackets">)</span>
          get<span class="symbol"> :edit</span>,<span class="symbol"> :id</span> =&#62; @score.id
        <span class="keywords">end</span>

        should_respond_with<span class="symbol"> :success</span>
      <span class="keywords">end</span>

      context <span class="string">"for another user's score"</span> <span class="keywords">do</span>
        setup <span class="keywords">do</span>
          @score = Factory<span class="brackets">(</span>:score<span class="brackets">)</span>
          get<span class="symbol"> :edit</span>,<span class="symbol"> :id</span> =&#62; @score.id
        <span class="keywords">end</span>

        should_respond_with<span class="symbol"> :unauthorized</span>
      <span class="keywords">end</span>
    <span class="keywords">end</span>
  <span class="keywords">end</span>

  context <span class="string">"An admin user"</span> <span class="keywords">do</span>
    setup <span class="keywords">do</span>
      @admin = Factory<span class="brackets">(</span>:admin<span class="brackets">)</span>
      sign_in_as @admin
    <span class="keywords">end</span>

    context <span class="string">"on GET to :edit"</span> <span class="keywords">do</span>
      context <span class="string">"for own score"</span> <span class="keywords">do</span>
        setup <span class="keywords">do</span>
          @score = Factory<span class="brackets">(</span>:score,<span class="symbol"> :user</span> =&#62; @admin<span class="brackets">)</span>
          get<span class="symbol"> :edit</span>,<span class="symbol"> :id</span> =&#62; @score.id
        <span class="keywords">end</span>

        should_respond_with<span class="symbol"> :success</span>
      <span class="keywords">end</span>

      context <span class="string">"for another user's score"</span> <span class="keywords">do</span>
        setup <span class="keywords">do</span>
          @score = Factory<span class="brackets">(</span>:score<span class="brackets">)</span>
          get<span class="symbol"> :edit</span>,<span class="symbol"> :id</span> =&#62; @score.id
        <span class="keywords">end</span>

        should_respond_with<span class="symbol"> :success</span>
      <span class="keywords">end</span>
    <span class="keywords">end</span>
  <span class="keywords">end</span>
<span class="keywords">end</span></code></pre>
<h2>Summary of Tools</h2>
<p>I should call <a href="http://flightcontrolled.com/">flightcontrolled</a>, the <a href="http://www.thoughtbot.com/">thoughtbot</a> project as I used several of their awesome tools. I used <a href="http://giantrobots.thoughtbot.com/2009/2/9/clearance-rails-authentication-for-developers-who-write-tests">clearance</a> for authentication, <a href="http://www.thoughtbot.com/projects/shoulda">shoulda</a> and <a href="http://www.thoughtbot.com/projects/factory_girl">factory girl</a> for testing, and <a href="http://www.thoughtbot.com/projects/paperclip">paperclip</a> for file uploads. This was the first project that I used factory girl on and I really like it. Again, I didn’t get the fuss until I used it, and then I was like “Oooooh! Sweet!”.</p>
<p>One of the cool things about paperclip is you can pass straight up convert options to imagemagick. Flight Control is a game that is played horizontally, so I knew all screenshots would need to be rotated 270 degress. I just added the following convert options (along with strip) to the paperclip call:</p>
<pre><code class="ruby">has_attached_file<span class="symbol"> :image</span>,
 <span class="symbol"> :styles</span> =&#62; <span class="symbol">{:thumb</span> =&#62; <span class="string">'100&#62;'</span>,<span class="symbol"> :full</span> =&#62; <span class="string">'480&#62;'</span>},
 <span class="symbol"> :default_style</span> =&#62;<span class="symbol"> :full</span>,
 <span class="symbol"> :convert_options</span> =&#62; <span class="symbol">{:all</span> =&#62; <span class="string">'-rotate 270 -strip'</span>}</code></pre>
<h2>Conclusion</h2>
<p>You don’t need some fancy plugin or a lot of code to add some basic permissions into your application. A simple module can go a long way. Also, start using Thoughtbot’s projects. I’m really impressed with the developer tools they have created thus far.</p></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Shoulda Roundup: Elegant, Maintainable Ruby Testing]]></title>
<link>http://thailehuy.wordpress.com/2009/05/06/shoulda-roundup-elegant-maintainable-ruby-testing/</link>
<pubDate>Wed, 06 May 2009 04:20:47 +0000</pubDate>
<dc:creator>thailehuy</dc:creator>
<guid>http://thailehuy.wordpress.com/2009/05/06/shoulda-roundup-elegant-maintainable-ruby-testing/</guid>
<description><![CDATA[Source: http://www.thoughtbot.com/projects/shoulda/ Making Tests Easy on the Fingers and Eyes The Sh]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Source: <a href="http://www.thoughtbot.com/projects/shoulda/" target="_blank">http://www.thoughtbot.com/projects/shoulda/</a></p>
<div id="description">
<h2>Making Tests Easy on the Fingers and Eyes</h2>
<p>The Shoulda gem makes it easy to write elegant, understandable, and maintainable Ruby tests. Shoulda consists of test macros, assertions, and helpers added on to the Test::Unit framework. It’s fully compatible with your existing tests, and requires no retooling to use.</p>
<ul>
<li><strong>Context &#38; Should blocks</strong> – context and should provide RSpec-like test blocks for Test::Unit suites. In addition, you get nested contexts and a much more readable syntax.</li>
<li><strong>Macros</strong> – Generate many ActionController and ActiveRecord tests with helpful error messages. They get you started quickly, and can help you ensure that your application is conforming to best practice.</li>
<li><strong>Assertions</strong> – Many common Rails testing idioms have been distilled into a set of useful assertions.</li>
</ul>
<p>The <a href="http://github.com/thoughtbot/shoulda">Shoulda gem</a> can be used for non-Rails projects</div>
<hr class="clear" />
<h2>Installation</h2>
<pre><code>
sudo gem install thoughtbot-shoulda --source=http://gems.github.com
</code></pre>
<h2>Usage</h2>
<h3>Context Helpers</h3>
<p>Stop killing your fingers with all of those underscores…  Name your tests with plain sentences!</p>
<pre><code class="ruby">
<span class="keywords">class</span> <span class="constant">UserTest</span> &#60; <span class="constant">Test</span><span class="operator">::</span><span class="constant">Unit</span>
  context <span class="string">"A User instance"</span> <span class="keywords">do</span>
    setup <span class="keywords">do</span>
     <span class="instancevar"> @user</span> = <span class="constant">User</span>.find<span class="brackets">(</span><span class="symbol">:first</span><span class="brackets">)</span>
    <span class="keywords">end</span>

    should <span class="string">"return its full name"</span> <span class="keywords">do</span>
      assert_equal <span class="string">'John Doe'</span>,<span class="instancevar"> @user</span>.full_name
    <span class="keywords">end</span>

    context <span class="string">"with a profile"</span> <span class="keywords">do</span>
      setup <span class="keywords">do</span>
       <span class="instancevar"> @user</span>.profile = <span class="constant">Profile</span>.find<span class="brackets">(</span><span class="symbol">:first</span><span class="brackets">)</span>
      <span class="keywords">end</span>

      should <span class="string">"return true when sent #has_profile?"</span> <span class="keywords">do</span>
        assert<span class="instancevar"> @user</span>.has_profile?
      <span class="keywords">end</span>
    <span class="keywords">end</span>
  <span class="keywords">end</span>
<span class="keywords">end</span>
</code></pre>
<p>Produces the following test methods:</p>
<pre><code>"test: A User instance should return its full name."
"test: A User instance with a profile should return true when sent #has_profile?."</code></pre>
<p>So readable!</p>
<h3>ActiveRecord Tests</h3>
<p>Quick macro tests for your ActiveRecord associations and validations:</p>
<pre><code class="ruby">
<span class="keywords">class</span> <span class="constant">PostTest</span> &#60; <span class="constant">Test</span><span class="operator">::</span><span class="constant">Unit</span><span class="operator">::</span><span class="constant">TestCase</span>
  should_belong_to <span class="symbol">:user</span>
  should_have_many <span class="symbol">:tags</span>, <span class="symbol">:through</span> =&#62; <span class="symbol">:taggings</span>

  should_require_unique_attributes <span class="symbol">:title</span>
  should_require_attributes <span class="symbol">:body</span>, <span class="symbol">:message</span> =&#62; /wtf/
  should_require_attributes <span class="symbol">:title</span>
  should_only_allow_numeric_values_for <span class="symbol">:user_id</span>
<span class="keywords">end</span>

<span class="keywords">class</span> <span class="constant">UserTest</span> &#60; <span class="constant">Test</span><span class="operator">::</span><span class="constant">Unit</span><span class="operator">::</span><span class="constant">TestCase</span>
  should_have_many <span class="symbol">:posts</span>

  should_not_allow_values_for <span class="symbol">:email</span>, <span class="string">"blah"</span>, <span class="string">"b lah"</span>
  should_allow_values_for <span class="symbol">:email</span>, <span class="string">"a@b.com"</span>, <span class="string">"asdf@asdf.com"</span>
  should_ensure_length_in_range <span class="symbol">:email</span>, 1..100
  should_ensure_value_in_range <span class="symbol">:age</span>, 1..100
  should_protect_attributes <span class="symbol">:password</span>
<span class="keywords">end</span>
</code></pre>
<p>Makes TDD so much easier.</p>
<h3>Controller Tests</h3>
<p>Macros to test the most common controller patterns…</p>
<pre><code class="ruby">
context <span class="string">"on GET to :show for first record"</span> <span class="keywords">do</span>
  setup <span class="keywords">do</span>
    get <span class="symbol">:show</span>, <span class="symbol">:id</span> =&#62; 1
  <span class="keywords">end</span>

  should_assign_to <span class="symbol">:user</span>
  should_respond_with <span class="symbol">:success</span>
  should_render_template <span class="symbol">:show</span>
  should_not_set_the_flash

  should <span class="string">"do something else really cool"</span> <span class="keywords">do</span>
    assert_equal 1, assigns<span class="brackets">(</span><span class="symbol">:user</span><span class="brackets">)</span>.id
  <span class="keywords">end</span>
<span class="keywords">end</span>
</code></pre>
<h3>Helpful Assertions</h3>
<p>More to come here, but have fun with what’s there.</p>
<pre><code class="ruby">
assert_same_elements<span class="brackets">(</span>[<span class="symbol">:a</span>, <span class="symbol">:b</span>, <span class="symbol">:c</span>], [<span class="symbol">:c</span>, <span class="symbol">:a</span>, <span class="symbol">:b</span>]<span class="brackets">)</span>
assert_contains<span class="brackets">(</span>[<span class="string">'a'</span>, <span class="string">'1'</span>], /\d/<span class="brackets">)</span>
assert_contains<span class="brackets">(</span>[<span class="string">'a'</span>, <span class="string">'1'</span>], <span class="string">'a'</span><span class="brackets">)</span>
</code></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Shoulda Custom Handcrafted Eyewear]]></title>
<link>http://momentumoffailure.wordpress.com/2009/05/01/shoulda-custom-handcrafted-eyewear/</link>
<pubDate>Fri, 01 May 2009 19:45:51 +0000</pubDate>
<dc:creator>momentumoffailure</dc:creator>
<guid>http://momentumoffailure.wordpress.com/2009/05/01/shoulda-custom-handcrafted-eyewear/</guid>
<description><![CDATA[It&#8217;s rare to come across a company that produces eyewear so unique and forward-thinking and ha]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="aligncenter size-full wp-image-2319" title="picture-11" src="http://momentumoffailure.wordpress.com/files/2009/05/picture-11.png" alt="picture-11" width="500" height="299" />It&#8217;s rare to come across a company that produces eyewear so unique and forward-thinking and have them <em>not</em> be from NYC/Paris/Tokyo/Etc. Denver, CO based, <a href="http://eyeshoulda.com" target="_blank">Shoulda Eyewear </a>produces the finest of spectacles handcrafted from solid wood and available in a wide-vareity of designs ($300-$500). Classic wayfarer models all the way to what is pictured here. Check out <a href="http://eyeshoulda.com/gallery.html#gallery/aedwardsspec.jpg" target="_blank">Shoulda&#8217;s gallery</a> for more. And if you don&#8217;t find anything there, the company prides itself on creating custom designs based on your specifications.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Double Shot #442]]></title>
<link>http://afreshcup.com/2009/04/30/double-shot-442/</link>
<pubDate>Thu, 30 Apr 2009 11:09:14 +0000</pubDate>
<dc:creator>Mike Gunderloy</dc:creator>
<guid>http://afreshcup.com/2009/04/30/double-shot-442/</guid>
<description><![CDATA[End of the month, hooray. If you&#8217;re not madly rushing to meet deadlines, you might enjoy some ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>End of the month, hooray. If you&#8217;re not madly rushing to meet deadlines, you might enjoy some of these links.</p>
</ul>
<li><strong><a href="http://github.com/ahoward/testy/tree/master">Testy</a></strong> &#8211; Yet another BDD framework for Ruby, this one with a minimalist vibe.</li>
<li><strong><a href="http://snk.tuxfamily.org/lib/dfect/">DFECT 0.1.0</a></strong> &#8211; And yes, another testing library for Ruby as well.</li>
<li><strong><a href="http://mediumexposure.com/techblog/shmacros">Shmacros</a></strong> &#8211; A bunch of useful shoulda macros.</li>
<li><strong><a href="http://rdoc.info/">rdoc.info</a></strong> &#8211; Github-connected RDoc builder that you can hook into pretty much any project.</li>
<li><strong><a href="http://lifehacker.com/5232049/flashbake-automates-version-control-for-nerdy-writers">Flashbake</a></strong> &#8211; Git interface for text files written in Python that can suck things like your Twitter status into commit messages. Just plain wacky.</li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Coulda. Woulda. Shoulda. ]]></title>
<link>http://shingirmingir.wordpress.com/2009/04/23/coulda-woulda-shoulda/</link>
<pubDate>Thu, 23 Apr 2009 20:54:17 +0000</pubDate>
<dc:creator>shingirmingir</dc:creator>
<guid>http://shingirmingir.wordpress.com/2009/04/23/coulda-woulda-shoulda/</guid>
<description><![CDATA[What to write. What to tell. What to share. Gather my thoughts. Put the words together. Put the sent]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><span lang="EN-US">What to write. What to tell. What to share. Gather my thoughts. Put the words together. Put the sentences together. Create a story out of the words and the sentences. Or write an allegory. Or maybe a poem.<br />
</span></p>
<p><span lang="EN-US">The thing is; I am so bored and empty that none of my stories are close to be put in words. I could tell you about the places I have traveled to. I could tell you about all the places I have ran away to. I could tell you about the endless green fields and the villages on Turkey&#8217;s Black Sea coast I have been dreaming about for ages. I could tell you about how it feels to fly coast to coast  above my emotional landscapes, not knowing where to touch down. I could tell you about the beauty that lies in between the opposites that/who never meet. I could tell you about ice cream breaks. I could tell you about my friend who had an emotional breakdown the other day and ended up doing an oil painting of me. I could tell you about how much it made me miss him. I could tell you about the abandoned, silent island. I could tell you about happiness. I could tell you about misunderstandings. I could tell you about evening sun. I could tell you I am amazed by the way Siri Hustvedt manages to put everything in words, even the things you did not know you thought about. I could tell you about getting on trains. I could tell you about getting off trains. I could tell you about how people manage to pass each other, not knowing when to get on and off the train. I could tell you that we all should be handed with road maps and time schedules, just so we don&#8217;t get caught by fate when we stumble on our way. I could tell you how much I romanticize Lucy&#8217;s mom who used to sit awake all night in the dark smoking cigarettes and listening to jazz records. I could tell you that I love to do the exact same thing, because it makes me calm and happy, not sad and lonely, like Lucy&#8217;s mom must have felt. I could tell you how good it feels it sit in a park listening to the sound of a city. I could tell you that I need something to ease me through the minefield of becoming too cynical. I could tell you about my best friend who thinks I have already become too cynical. </span></p>
<p><span lang="EN-US">I would tell you about the strange, little things that have happened lately if I only knew how.</span></p>
<p>Well, what do you know, I did manage to write something after all. Better than nothing, I would say.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[9.3.9]]></title>
<link>http://danbychoi.wordpress.com/2009/03/10/939/</link>
<pubDate>Mon, 09 Mar 2009 23:27:17 +0000</pubDate>
<dc:creator>DanbyChoi</dc:creator>
<guid>http://danbychoi.wordpress.com/2009/03/10/939/</guid>
<description><![CDATA[Hey Det var ÈN deilig dag på skolen i dag&#8230; Studietid (leksetid), Kunst og håndverk to timer, t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Hey <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </strong></p>
<p>Det var ÈN deilig dag på skolen i dag&#8230; Studietid (leksetid), Kunst og håndverk to timer, time uten noen lærer pga. mangel på vikarer, og en siste time med dramatisering&#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Så det var ikke stor stress!</p>
<p>Men det er deilig da, i og med at vi hadde en såppass slappe-av helg denne uka&#8230; Vi hadde fri torsdag og fredag og halve onsdag pga. eksamen&#8230; Som jeg fikk 5+ på! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Akkurat nå har jeg stått og danset med headset på hodet, og jeg tenker å lage en ny koreografi&#8230;<br />
Denne gangen til &#8220;<strong>Should&#8217;ve let you go</strong>&#8221; av Keyshia Cole&#8230; Jeg ELSKER sangen, så mye følelser <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/PRjjSxZ_Pog&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/PRjjSxZ_Pog&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>Hva syns du? Jeg tror det blir bra <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Men nå skal jeg legge meg!<br />
</strong>Jeg som hadde målet å legge seg før 00:00 på hverdagene&#8230; HM&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Double Shot #404]]></title>
<link>http://afreshcup.com/2009/03/05/double-shot-404/</link>
<pubDate>Thu, 05 Mar 2009 11:30:46 +0000</pubDate>
<dc:creator>Mike Gunderloy</dc:creator>
<guid>http://afreshcup.com/2009/03/05/double-shot-404/</guid>
<description><![CDATA[Oh, and&#8230;Rails 2.3 RC2. Go forth and test. Vlad the Deployer 1.3.0 &#8211; New release of this ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Oh, and&#8230;<strong><a href="http://weblog.rubyonrails.org/2009/3/5/rails-2-3-rc2-final-stop-before-release">Rails 2.3 RC2</a></strong>. Go forth and test.</p>
</ul>
<li><strong><a href="http://blog.zenspider.com/2009/03/vlad-version-130-has-been-rele.html">Vlad the Deployer 1.3.0</a></strong> &#8211; New release of this simpler alternative to Capistrano, though it&#8217;s getting more and more features itself. </li>
<li><strong><a href="http://omgbloglol.com/help-make-a-free-ruby-conferen">help make a free ruby conference a reality</a></strong> &#8211; Jeremy McAnally is after donations to fund the next Ruby Hoedown.</li>
<li><strong><a href="http://pennysmalls.com/2009/03/04/rails-23-breakage-and-fixage/">Rails 2.3 breakage and fixage</a></strong> &#8211; Some warnings about things to watch out for in your tests.</li>
<li><strong><a href="http://giantrobots.thoughtbot.com/2009/3/4/shoulda-time-for-a-little-love-for-actioncontro-ller">Shoulda 2.10: time for a little love for ActionController</a></strong> &#8211; Shoulda is moving right along.</li>
<li><strong><a href="http://www.pathf.com/blogs/2009/03/uploading-files-to-rails-metal/">Uploading Files to Rails Metal</a></strong> &#8211; Without blocking processes. Wasn&#8217;t that the whole point of Merb?</li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Double Shot #397]]></title>
<link>http://afreshcup.com/2009/02/23/double-shot-397/</link>
<pubDate>Mon, 23 Feb 2009 12:17:00 +0000</pubDate>
<dc:creator>Mike Gunderloy</dc:creator>
<guid>http://afreshcup.com/2009/02/23/double-shot-397/</guid>
<description><![CDATA[It was a pretty busy weekend in the Rails world (and other spots that I hang out online). File Downl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>It was a pretty busy weekend in the Rails world (and other spots that I hang out online).</p>
<li><strong><a href="http://www.therailsway.com/2009/2/22/file-downloads-done-right">File Downloads Done Right</a></strong> &#8211; Koz walks you through managing big downloads without blocking your Rails processes.</li>
<li><strong><a href="http://getsprockets.org/">Sprockets</a></strong> &#8211; New Ruby library for managing JavaScript source files. I probably need to dig into this in my copious spare time.</li>
<li><strong><a href="http://entifyr.com/">Entifyr</a></strong> &#8211; Instant conversion of random bits of text to ISO-8859-1 encoded web safe content.</li>
<li><strong><a href="http://giantrobots.thoughtbot.com/2009/2/20/mixing-cucumber-with-test-unit">Mixing Cucumber with Test::Unit/Shoulda</a></strong> &#8211; An interesting bit of BDD crossover.</li>
<li><strong><a href="http://docs.jquery.com/Release:jQuery_1.3.2">jQuery 1.3.2</a></strong> &#8211; Maintenance release that includes some good-looking performance improvements.</li>
<li><strong><a href="http://github.com/thoughtbot/limerick_rake/tree/master">limerick_rake</a></strong> &#8211; Collection of useful Rake tasks from ThoughtBot.</li>
<li><strong><a href="http://redcloth.org/">RedCloth 4.1.9</a></strong> &#8211; Now with Ruby 1.9 support.</li>
<li><strong><a href="http://blog.olszowka.de/2009/01/22/setting-up-the-whole-rails-stack-from-a-single-debian-meta-package/">Setting up the whole Rails stack from a single Debian meta package in 10 minutes</a></strong> &#8211; With the help of Phusion&#8217;s debgem service.</li>
<li><strong><a href="http://benschwarz.github.com/passenger-stack/">Passenger-Stack</a></strong> &#8211; Sprinkle scripts to quickly provision a Rails server. (via <a href="http://www.rubyinside.com/passenger-stack-quickly-install-a-full-ruby-and-passenger-stack-1533.html">Ruby Inside</a>)</li>
<li><strong><a href="http://arcadia.rubyforge.org/">Arcadia</a></strong> &#8211; Lightweight open source Ruby IDE (no Rails tie-ins yet, it looks like).</li>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Double Shot #388]]></title>
<link>http://afreshcup.com/2009/02/10/double-shot-388/</link>
<pubDate>Tue, 10 Feb 2009 12:39:25 +0000</pubDate>
<dc:creator>Mike Gunderloy</dc:creator>
<guid>http://afreshcup.com/2009/02/10/double-shot-388/</guid>
<description><![CDATA[Well, after joining the Rails Activists and the creation of ActionRails, I can finally complete my t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Well, after joining the <strong><a href="http://rubyonrails.org/activists">Rails Activists</a></strong> and the creation of <strong><a href="http://www.actionrails.com/">ActionRails</a></strong>, I can finally complete my trifecta of Big Announcements for the year: I&#8217;m co-authoring <strong><a href="http://www.manning.com/katz/">Rails 3 In Action</a></strong>, to be published by Manning late this year. <strong>UPDATE</strong>: No, as it turns out, I&#8217;m not. For various reasons, I&#8217;ve dropped out of that book project.</p>
<li><strong><a href="http://giantrobots.thoughtbot.com/2009/2/9/clearance-rails-authentication-for-developers-who-write-tests">Clearance: Rails authentication for developers who write tests</a></strong> &#8211; Yup, one more authentication library, this one from the ThoughtBot guys.</li>
<li><strong><a href="http://codehappy.wordpress.com/2009/02/09/rspec-and-shoulda/">RSpec and Shoulda</a></strong> &#8211; Using the two together for maximum goodness.</li>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Using shoulda, webrat to write integration tests for rails ]]></title>
<link>http://codese.wordpress.com/2009/02/05/using-shoulda-webrat-to-write-integration-tests-for-rails/</link>
<pubDate>Thu, 05 Feb 2009 19:58:33 +0000</pubDate>
<dc:creator>raavansh</dc:creator>
<guid>http://codese.wordpress.com/2009/02/05/using-shoulda-webrat-to-write-integration-tests-for-rails/</guid>
<description><![CDATA[Webrat is library to write acceptance tests for ruby web applications. I also like shoulda for its c]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="webrat" href="http://github.com/brynary/webrat/tree/master" target="_blank">Webrat</a> is library to write acceptance tests for ruby web applications. I also like <a title="shoulda" href="http://github.com/thoughtbot/shoulda/tree/master" target="_blank">shoulda</a> for its context. However using the two in conjunction has been little fun. I wanted to<a title="rails integration testing by jamis buck" href="http://weblog.jamisbuck.org/2006/3/9/integration-testing-in-rails-1-1" target="_blank"> multiple sessions testing</a>. Following is the code I used to get it done using shoulda and webrat. It might turn out to be useful example for some.</p>
<pre class="brush: ruby;">
require File.dirname(__FILE__) + '/../test_helper'

class UserStories  'some@one.com'
      fill_in &quot;password&quot;, :with =&gt; &quot;idunno&quot;
      click_button
      assert_equal '/session', path
    end
  end

  context 'A User' do
    setup do
      visit &quot;login&quot;
      assert_response :success
      fill_in &quot;email&quot;,:with =&gt; users(:tom).email
      fill_in &quot;password&quot;, :with =&gt; &quot;123456&quot;
      click_button
      assert_equal '/profile', path
    end

    should 'be able to login with valid email and password' do
      visit 'forums/new'
      assert_response :success
    end
  end

end
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Double Shot #384]]></title>
<link>http://afreshcup.com/2009/02/04/double-shot-384/</link>
<pubDate>Wed, 04 Feb 2009 10:33:12 +0000</pubDate>
<dc:creator>Mike Gunderloy</dc:creator>
<guid>http://afreshcup.com/2009/02/04/double-shot-384/</guid>
<description><![CDATA[Have I mentioned lately that we&#8217;re available for hire? Well, we are. 3-0-unstable Merge ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Have I mentioned lately that we&#8217;re available for hire? Well, we are.</p>
</ul>
<li><strong><a href="http://yehudakatz.com/2009/02/03/3-0-unstable-merge/">3-0-unstable Merge</a></strong> &#8211; Now that 2.3 RC1 is out, things are heating up on the Rails 3.0 front.</li>
<li><strong><a href="http://giantrobots.thoughtbot.com/2009/2/3/speculating-with-shoulda">Speculating with Shoulda</a></strong> &#8211; News of shoulda development, including RSpec compatibility. </li>
<li><strong><a href="http://spreehq.org/articles/2009/02/03/spree-0-6-0-released/">Spree 0.6.0 Released</a></strong> &#8211; This open source commerce platform now runs on Rails 2.2.2 and makes use of I18n features in Rails.</li>
<li><strong><a href="http://github.com/blog/333-easy-git">Easy Git!</a></strong> &#8211; Git training wheels for Subversion users.</li>
<li><strong><a href="http://weblog.rubyonrails.com/2009/2/4/rails-guides-gets-a-facelift">Rails Guides Gets a Facelift</a></strong> &#8211; A new look for one of the documentation projects that I&#8217;m involved with.</li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Shoulda macros to make your tests drier. ]]></title>
<link>http://codese.wordpress.com/2009/02/03/should-macros-to-reduce-make-your-tests-drier/</link>
<pubDate>Tue, 03 Feb 2009 11:40:50 +0000</pubDate>
<dc:creator>raavansh</dc:creator>
<guid>http://codese.wordpress.com/2009/02/03/should-macros-to-reduce-make-your-tests-drier/</guid>
<description><![CDATA[Its been a while since I have been using shoulda and its pretty awesome addition to your rails TDD a]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Its been a while since I have been using <a title="shoulda project " href="http://thoughtbot.com/projects/shoulda/" target="_blank">shoulda</a> and its pretty awesome addition to your rails TDD artilery. Of what little I have known of  it has helped me to write my own first shoulda macro.</p>
<p>Here it is</p>
<pre class="brush: ruby;">
module ThoughtBot
  module Shoulda
    module Controller
      module Macros
        # :section test macro
        # macro creating test asserting that actions requiring login are redirected to login
        def should_request_login(action, params = {}, method = :get)
          context &quot;#{method.to_s.upcase} on #{action.to_s} &quot; do
            setup do
              case method
              when :get
                get action, params
              when :post
                post action, params
              when :put
                put action, params
              when :delete
                delete action, params
              end
            end
            should &quot;should redirect to login&quot; do
              assert_response :redirect
              assert_redirected_to new_session_path
            end
          end
        end
      end
    end
  end
end
</pre>
<p>I am working on few more. May be I may post them sometime later. </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Double Shot #368]]></title>
<link>http://afreshcup.com/2009/01/12/double-shot-368/</link>
<pubDate>Mon, 12 Jan 2009 12:34:31 +0000</pubDate>
<dc:creator>Mike Gunderloy</dc:creator>
<guid>http://afreshcup.com/2009/01/12/double-shot-368/</guid>
<description><![CDATA[Looking forward to a Monday of massive code merges. If &#8220;looking forward&#8221; is the right wo]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Looking forward to a Monday of massive code merges. If &#8220;looking forward&#8221; is the right word for it.</p>
</ul>
<li><strong><a href="http://github.com/josevalim/rails-footnotes/tree/master">rails-footnotes</a></strong> &#8211; Another debug toolbar plugin for Rails.</li>
<li><strong><a href="http://www.djangobook.com/en/2.0/">The Django Book 2.0</a></strong> &#8211; Now starting on revisions to bring it current.</li>
<li><strong><a href="http://technicalpickles.com/posts/test-or-die-validates-uniqueness-of-shoulda-and-factory-girl-edition">Test Or Die: Validates Uniqueness Of, Shoulda and Factory Girl Edition</a></strong> &#8211; An exercise in making tests less repetitive.</li>
<li><strong><a href="http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/">ActiveRecord threading issues and resolutions</a></strong> &#8211; Concerns specific to ActiveRecord 2.2 and MySQL.</li>
<li><strong><a href="http://www.robbyonrails.com/articles/2009/01/11/subdomain-accounts-with-ruby-on-rails-explained">Subdomain accounts with Ruby on Rails explained</a></strong> &#8211; Robby Russell digs into some of the common patterns here.</li>
<li><strong><a href="http://ipinfo.info/netrenderer/">IE Net Renderer</a></strong> &#8211; Free in-browser rendering to see how things look on IE 5.5 through IE 8 Beta 2.</li>
<li><strong><a href="http://gitready.com/">git ready</a></strong> &#8211; Daily tips on git usage. Definitely an RSS feed to subscribe to.</li>
<li><strong><a href="http://www.khelll.com/blog/ruby/the-power-of-jruby/">The power of JRuby</a></strong> &#8211; Some reasons why you might want to pay attention to this project.</li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[small-ish debate on BDD]]></title>
<link>http://rezaprima.wordpress.com/2008/11/18/small-ish-debate-on-bdd/</link>
<pubDate>Tue, 18 Nov 2008 06:17:46 +0000</pubDate>
<dc:creator>Reza Primardiansyah</dc:creator>
<guid>http://rezaprima.wordpress.com/2008/11/18/small-ish-debate-on-bdd/</guid>
<description><![CDATA[Courtenay started it, stating that his team stopped using rSpec, saying We wasted a day or two (thre]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Courtenay started it, stating that <a href="http://blog.caboo.se/articles/2008/11/4/we-ve-stopped-using-rspec">his team stopped using rSpec</a>, saying</p>
<blockquote><p> We wasted a day or two (three, maybe four developers) which equates to several thousand dollars in wasteage. It was also really infuriating &#8212; the culmination of a few years of frustration of rSpec&#8217;s weirdnesses.</p></blockquote>
<p>They left rspec and used rr, context, and matchy instead. Many other favorite library proposed in the comments.</p>
<p>Josh Susser compared rSpec with shoulda and test/spec in his <a href="http://blog.hasmanythrough.com/2008/6/1/the-great-test-framework-dance-off">The Great Test Framework Dance Off</a>.</p>
<p>David Chelimsky responded and stated that some of Josh&#8217;s criticism was true, but</p>
<blockquote><p>What Josh didn’t know at the time, and this is definitely worthy of a ding for us not documenting things well enough, is rspec’s simple_matcher method that let’s you create simple matchers in just a few lines. Here’s the example in test/unit from Josh’s talk:</p>
<p>def assert_sorted(actual, message=nil, &#38;block)<br />
  expected = actual.sort(&#38;block)<br />
  assert_equal expected, actual, &#8220;Order is wrong:&#8221;<br />
end<br />
assert_sorted(tags) { &#124;a,b&#124; a.name  b.name }</p>
<p>And here’s the same thing with simple_matcher:<br />
def be_sorted<br />
  simple_matcher(&#8220;a sorted list&#8221;) {&#124;actual&#124; actual.sort == actual}<br />
end<br />
[1,2,3].should be_sorted</p>
</blockquote>
<p>Dan Croak from Toughtbot fame <a href="http://giantrobots.thoughtbot.com/2008/11/7/a-critical-look-at-the-current-state-of-ruby-testing">spoke up also</a>, criticizing another BDD tool, Shoulda, stating that, like rspec, it adds complexity to achieve virtually no result, comparing it to test/unit that is already included in Ruby core library, faster, and simpler.</p>
<p>Later, Pat Maddox refutes it, stating that <a href="http://evang.eli.st/blog/2008/11/12/sometimes-a-tool-isn-t-just-a-tool">sometimes a tool is not just a tool</a>. That is, TDD / BDD does do something important. Making him keeping his responsibility</p>
<blockquote><p>It is my responsibility to keep existing code working, to improve existing code to make it more maintainable, and to write new code that functions and is maintainable. The best way I&#8217;ve found to do this is to do TDD. It&#8217;s not the only way, of course, just like GTD isn&#8217;t the only system for managing your workload. But it&#8217;s proven to be pretty damn effective.</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[CSI: 9.07: Woulda, Coulda, Shoulda]]></title>
<link>http://tvlisting.wordpress.com/2008/11/16/csi-907-woulda-coulda-shoulda/</link>
<pubDate>Sun, 16 Nov 2008 05:57:18 +0000</pubDate>
<dc:creator>korbinxy</dc:creator>
<guid>http://tvlisting.wordpress.com/2008/11/16/csi-907-woulda-coulda-shoulda/</guid>
<description><![CDATA[“CSI: Crime Scene Investigation” brings back the miniature killer to the screen in an episode called]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img src="http://download-csi-episodes.sequd.com/wp-content/uploads/2008/11/111508-1740-csi907woul1.png" alt="" /></p>
<p><span style="font-family:Times New Roman;font-size:12pt;">“<a href="http://download-csi-episodes.sequd.com/"><span style="color:blue;text-decoration:underline;">CSI: Crime Scene Investigation</span></a>” brings back the miniature killer to the screen in an episode called “Woulda, Coulda, Shoulda”. One of the most notorious killers who produces the biggest mystery for the CSI team, Natalie Davis aka The Miniature Killer is being decided on her fate when Grissom is called to testify at the competency hearing of her.</p>
<p>Also, the murder of a mother and her young child appears to be connected to a suspect in a CSI investigation from over a decade ago. The murdered woman was once married to a man who went for a killing spree. “The West Wing” Joshua Malina guest stars in the November 20 episode.<br />
<span style="color:black;"><br />
On other news, it has been announced through a press release that Laurence Fishburne will enter the show as well-known criminal pathologist Dr. Raymond Langston in the December 11 episode which is called “19 Down”. In the episode, the team will discover a link between a new murder and the infamous “Dick and Jane Killer”. Fishburne is added to the cast in preparation of short-handedness the quarter will experience when William Petersen who plays Gil Grissom quits</span> the show the end of this year.<br />
</span></p>
<p><a href="http://sequd.com/Download-CSI-Episodes.html" target="_blank"><span style="font-family:Lucida Calligraphy;font-size:14pt;"><strong>Download CSI: “Woulda, Coulda, Shoulda” Free</strong></span></a><span style="font-family:Lucida Calligraphy;font-size:14pt;"><strong><br />
</strong></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Correctly Handle OpenID Updates]]></title>
<link>http://mikeburnscoder.wordpress.com/2008/11/08/correctly-handle-openid-updates/</link>
<pubDate>Sat, 08 Nov 2008 16:10:37 +0000</pubDate>
<dc:creator>Mike Burns</dc:creator>
<guid>http://mikeburnscoder.wordpress.com/2008/11/08/correctly-handle-openid-updates/</guid>
<description><![CDATA[OpenID is pretty well established as a login infrastructure, but a topic often ignored is correctly ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://openid.net/">OpenID</a> is pretty well established as a login infrastructure, but a topic often ignored is correctly letting the user change his saved OpenID. Don&#8217;t just save the text they enter! <strong>Verify that they&#8217;ve entered their valid OpenID</strong>.</p>
<p>The user model needs to pass this test:</p>
<pre class="brush: ruby;">
should_have_db_column :new_openid_identity, :type =&gt; 'string'
</pre>
<p>The view on /account/edit needs to pass this test:</p>
<pre class="brush: ruby;">
context &quot;logged in&quot; do
  setup { session[:user_id] = Factory(:user).id }

  context &quot;GET to edit&quot; do
    setup { get :edit }

    should &quot;have a form for their OpenID info&quot; do
      assert_select 'form[action=?][method=post]', openid_path do
        assert_select 'input[type=hidden][name=_method][value=put]'
        assert_select 'input[type=text][name=?]',
                      'user[new_openid_identity]'
        assert_select 'input[type=submit]'
      end
    end
  end
end
</pre>
<p>And, most importantly, the OpenidsController needs to pass the test suite in <a href="http://gist.github.com/23084">gist 23084</a>.</p>
<p>(All these tests assume <a href="http://thoughtbot.com/projects/factory_girl">FactoryGirl</a> and <a href="http://thoughtbot.com/projects/shoulda">Shoulda</a>; re-write in <a href="http://rspec.info/">RSpec</a> or <a href="http://pyunit.sourceforge.net/">PyUnit</a> or whatever as you see fit.) </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Could'a, Should'a, Would'a ]]></title>
<link>http://duchessinc.wordpress.com/2008/10/22/coulda-shoulda-woulda/</link>
<pubDate>Wed, 22 Oct 2008 13:21:57 +0000</pubDate>
<dc:creator>the duchess</dc:creator>
<guid>http://duchessinc.wordpress.com/2008/10/22/coulda-shoulda-woulda/</guid>
<description><![CDATA[You&#8217;ve heard the phrase before. I could have done this. He should have done that. I would]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>You&#8217;ve heard the phrase before. I could have done this. He should have done that. I would&#8217;ve finished but . .</p>
<p> </p>
<p>Well baby &#8211; talk&#8217;s cheap. I&#8217;m trying to get rid of the should and the could. Better to deal with reality and what is instead of making up a thousand and one excuses for yourself and those around you. Your actions and the actions of others are reality. Sure you could work out, and you probably should work out. But unless you take action and get off the couch you can could and should forever.</p>
<p> </p>
<p>This week&#8217;s column on Singe Minded Women is on becoming aware of all the could&#8217;a, should&#8217;a, would&#8217;a in your daily dialogue (spoken and unspoken). Check it out and give it a try.</p>
<p> </p>
<blockquote><p><a href="http://blogs.singlemindedwomen.com/?cat=1594">http://blogs.singlemindedwomen.com/?cat=1594</a></p>
<p> </p></blockquote>
<p><a href="http://duchessinc.files.wordpress.com/2008/10/trees.jpg"><img class="aligncenter size-medium wp-image-401" title="trees" src="http://duchessinc.wordpress.com/files/2008/10/trees.jpg?w=300" alt="" width="300" height="225" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Test All The Fuckin Time]]></title>
<link>http://queroseragil.wordpress.com/2008/08/28/test-all-the-fuckin-time/</link>
<pubDate>Thu, 28 Aug 2008 14:55:40 +0000</pubDate>
<dc:creator>Rafael Mueller</dc:creator>
<guid>http://queroseragil.wordpress.com/2008/08/28/test-all-the-fuckin-time/</guid>
<description><![CDATA[Test All The Fucking Time é o título de uma Lightning Talk que Brian Liles fez na Ruby Hoedown 2008.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://rubyhoedown2008.confreaks.com/05-bryan-liles-lightning-talk-tatft-test-all-the-f-in-time.html" target="_blank">Test All The Fucking Time</a> é o título de uma <a href="http://en.wikipedia.org/wiki/Lightning_Talk" target="_blank">Lightning Talk</a> que <a href="http://smartic.us/" target="_blank">Brian Liles</a> fez na <a href="http://www.rubyhoedown.com/" target="_blank">Ruby Hoedown 2008</a>.</p>
<p>São apenas 12 minutos, onde a mensagem principal é: Test All The Fucking Time!</p>
<p>Vale a pena assitir!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Poultry, Starch, Veg]]></title>
<link>http://thedinnerhour.wordpress.com/2008/06/28/poultry-starch-veg/</link>
<pubDate>Sat, 28 Jun 2008 01:14:26 +0000</pubDate>
<dc:creator>thedinnerhour</dc:creator>
<guid>http://thedinnerhour.wordpress.com/2008/06/28/poultry-starch-veg/</guid>
<description><![CDATA[Menu: Chipotle-stuffed turkey burgers * sweet potato oven fries with chipotle ketchup * sauteed spin]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Menu: Chipotle-stuffed turkey burgers * sweet potato oven fries with chipotle ketchup * sauteed spinach</p>
<p>Burgers<br />
Ground turkey<br />
Sea salt<br />
Garlic<br />
Chipotle peppers in adobo</p>
<p>Mix pack of ground turkey with sea salt and garlic. Shape into patties; cut in half horizontally and place a small chipotle in the center. Grill until done. During last few minutes. add reduced-fat Mexican cheese on top to melt.</p>
<p>Fries:<br />
Cook sweet potato oven fries according to package (I used Alexia frozen ones; 425 for 20 minutes). </p>
<p>Chipotle ketchup:<br />
Chop two chipotle peppers in small bowl; add some of adobe sauce. Mix with tomato ketchup to taste; add 2 tsp balsamic vinegar.</p>
<p>Spinach:<br />
Heat 2 T olive oil in large non-stick skillet/wok, on high. Add baby spinach; saute until wilted. Grind sea salt and garlic over.</p>
<p>Would I make it again?<br />
Not quite the same way. The chipotle was too hot, though M liked it a lot. I might stuff cheese with the chipotle. I might just use the chipotle ketchup and leave out the pepper entirely. I&#8217;d also wanted to make a jicama-Granny Smith slaw or other salad, but ran out of time and energy. Big afternoon at work, pretty tired. So glad to sleep in in the morning.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[13/06/08: Etincelantes ]]></title>
<link>http://hgoseye.wordpress.com/2008/06/15/130608-etincelantes/</link>
<pubDate>Sun, 15 Jun 2008 14:14:27 +0000</pubDate>
<dc:creator>Hgo</dc:creator>
<guid>http://hgoseye.wordpress.com/2008/06/15/130608-etincelantes/</guid>
<description><![CDATA[__________________________________________________________________________ Vendredi 13 juin 2008 Sun]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h1><span style="color:fuchsia;">__________________________________________________________________________</span></h1>
<div style="text-align:center;"><img src="http://img175.imageshack.us/img175/4033/lakersblogzt9.jpg" alt="" width="417" height="100" /></div>
<div style="text-align:center;"><span> </span></div>
<p class="MsoNormal" style="text-align:center;"><span> </span></p>
<p class="MsoNormal" style="text-align:right;"><span style="text-decoration:underline;"><strong><em><span style="text-decoration:underline;"><span style="color:#ff9900;">Vendredi 13 juin 2008<br />
</span></span></em></strong></span></p>
<p class="MsoNormal" style="text-align:right;"><span style="color:#ff9900;"><strong>Sun 93  &#8211; Sparks 98<br />
</strong></span></p>
<p class="MsoNormal" style="text-align:center;">
<p class="MsoNormal" style="text-align:center;">
<p style="text-align:center;"><span style="color:indigo;"><span style="font-weight:bold;"><span style="font-size:24px;line-height:normal;">Etincelantes<br />
</span></span></span></p>
<p style="text-align:center;">
<p style="text-align:center;"><img src="http://img127.imageshack.us/img127/4783/47740b0282f09603880630esd4.jpg" alt="" /></p>
<p style="text-align:center;">
<p style="text-align:justify;">
<p style="text-align:justify;"><a href="http://sports.yahoo.com/wnba/players/4258/;_ylt=AvEN3SMOpfaofhRMFPZRANlbvrYF"><span style="color:#800080;"><strong><em>S</em></strong></span>idney Spencer</a> plante un trois points à 1’18 de la fin de la prolongation auquel <a href="http://sports.yahoo.com/wnba/players/491/;_ylt=AhAMPTETK9ZP3BXw31X.rv1bvrYF">Kiesha Brown</a> ajoute 4 lancers francs et une interception et les Sparks de Los Angeles s’imposent 98-93 face à la meilleure équipe de ce début de saison 2008.</p>
<p style="text-align:justify;">Brown égalise son record de passes décisives en carrière avec 11 réalisations tandis que Lisa Leslie atomise la raquette du Sun de Connecticut avec 22 points et 10 rebonds. Le cinq majeur est à nouveau très prolifique. <a href="http://sports.yahoo.com/wnba/players/244/;_ylt=ApkuiCAgatW4Mc_3iuxVwgtbvrYF">DeLisha Milton-Jones</a> marque 20 points bien suivie par <a href="http://sports.yahoo.com/wnba/players/422/;_ylt=AlWYDIdN9gRj_TYrxLnCYPFbvrYF">Marie Ferdinand</a>-Harris et ses 19 unités (record en saison). LAS jump à 6-2 et remporte leur 4<sup>ème</sup> succès lors des 5 dernières rencontres. « <em>Mes coéquipières sont à créditer pour mes 11 passes</em> » insiste Brown, « e<em>lles ont rentré leurs shoots. Nous savions que nous aurions l’avantage sur le Sun à l’intérieur. Nous en avons bien profité grâce à nos joueuses poste bas (Leslie, Jones et Candace Parker) […] C’était juste une question d’ambition et d’exécution.</em> »</p>
<p style="text-align:justify;">Pourtant le Sun à tout fait pour résister malgré son désavantage de taille. <a href="http://sports.yahoo.com/wnba/players/631/;_ylt=Ar5lI2RZrJ6eY4CW3GOuC3BbvrYF">Lindsay Whalen</a> marque 20 points et attrape 7 rebonds et 4 interceptions. Mais tous leurs efforts la série de 5 victoires consécutives prend fin (8-2). <a href="http://sports.yahoo.com/wnba/players/503/;_ylt=AoQYmT7XQZY2fcwm2f8n7spbvrYF">Asjha Jones</a> et <a href="http://sports.yahoo.com/wnba/players/248/;_ylt=AtMn7MJDdAP0FybY7SrRETxbvrYF">Tamika Whitmore</a> ont chacune ajouté 18 points. «<em> Contrairement à notre match contre Phœnix et notre prolongation contre Indiana, nous n’avons pas perdu notre basket</em> <em>en fin de rencontre</em> » analyse coach Cooper en conférence de presse, « <em>ça a été très important pour nous.</em> »</p>
<p style="text-align:justify;">Pourtant Connecticut accusait déjà 14 points de retard dans le premier quart temps. Le Sun est revenu à 93-91 avant que Spencer rentre un trois points pour les locales et les fasse virer en tête d’un point. « <em>Candace (17 points, 9 rebonds et 4 passes) a placé un bon écran et DeLisha m’a trouvée </em>» déclare Spencer, « <em>elles [Sun] faisaient attention à Parker donc elles ont mis un peu de temps à faire leur rotation défensive et à me couvrir. Le tir était totalement ouvert. </em>» Puis Brown vole un ballon à 22.9 secondes du buzzer, reçoit une faute de Whalen et rentre ses deux pénalités (<em>18.9 secondes à jouer</em>). Milton-Jones touche et dévie ensuite un rebond des mains de Whitmore. Brown reçoit deux nouveaux lancers francs qu’elle convertit (<em>0.7 secondes à jouer</em>). «<em> C’est l’un de ces matches où l’on évite les « woulda, coulda, shoulda </em>» avoue Mike Thibault, coach des leaders à l’est, «<em> les filles doivent comprendre que les petits détails sont de grandes choses. Je n’ai pas aimé nos séquences défensives vers la fin du match.</em> »</p>
<p class="MsoNormal" style="text-align:justify;"><span><span style="color:#ff9900;">Fortes d’un nouveau succès de rang après la victoire face au Shock de Détroit, LAS apparaît de nouveau comme un favoris au titre suprême.</span> Rendez-vous ce week-end pour une visite dans la capitale californienne pour en découdre avec un ennemis intime : les </span><span lang="EN-GB">Monarchs</span><span>. <span> </span></span></p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;"><span style="color:indigo;"><span style="font-weight:bold;"><span style="font-size:18px;line-height:normal;">Scoreboard à la fin du match</span></span></span></p>
<p class="MsoNormal" style="text-align:center;"><img src="http://img137.imageshack.us/img137/3192/laconnecticutbh3.jpg" alt="" /></p>
<p class="MsoNormal" style="text-align:center;">
<p class="MsoNormal" style="text-align:center;">
<p class="MsoNormal" style="text-align:center;">
<p style="text-align:left;"><span style="font-weight:bold;"><span style="color:red;"><span style="font-size:24px;line-height:normal;">Médias</span></span></span></p>
<p style="text-align:left;"><span style="font-weight:bold;"><span style="font-size:18px;line-height:normal;">Versus Sun</span></span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span> </span></p>
<p style="text-align:center;">
<p style="text-align:center;"><span style="font-weight:bold;">Retrouvez les photos du match dans le forum en  <a href="http://provenzale.celeonet.fr/viewtopic.php?p=409026#409026" target="_blank"><span style="color:indigo;"> Cliquant ici</span></a></span></p>
<p style="text-align:center;"><img src="http://img516.imageshack.us/img516/4434/1e5e0eb4828296da39edc4exv9.jpg" alt="" /></p>
<p style="text-align:center;">
<p style="text-align:center;"><span style="color:red;"><span style="font-weight:bold;"><span style="font-size:28px;line-height:normal;">La vidéo du jour</span></span></span></p>
<p style="text-align:center;"><strong><span style="color:#ff9900;">Candace Parker Has the Best Rookie Debut in WNBA History</span></strong></p>
<p style="text-align:center;"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/HsCks-kBfKc&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/HsCks-kBfKc&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p style="text-align:center;">
<p style="text-align:center;"><span class="postbody"><span style="color:red;"><span style="font-weight:bold;"><span style="font-size:28px;line-height:normal;">Prochain rendez-vous Samedi 14 juin<br />
Sparks @ Monarchs<br />
</span></span></span></span></p>
<p style="text-align:center;">
<p style="text-align:center;"><span style="font-style:italic;"><span style="color:#cc99ff;">Srces: CL/NBA/Espn/LAT </span></span></p>
<p style="text-align:center;"><span style="color:#ccffff;"><span style="font-weight:bold;">“Why can’t America realize that falling in love with Kobe doesn’t mean breaking up with Michael?” Rick Reilly</span></span></p>
<p style="text-align:center;">
<p style="text-align:center;"><a title="Ultimate Evo Team Set" href="http://provenzale.celeonet.fr/viewtopic.php?t=17473&#38;highlight=" target="_blank"><img src="http://nsm01.casimages.com/img/2008/04/25/08042509463461271992132.jpg" alt="" width="390" height="40" /></a></p>
<p style="text-align:center;">
<p style="text-align:center;"><span class="postbody"><a class="postlink" href="../" target="_blank"><img src="http://hgoseye.files.wordpress.com/2008/04/kobe.jpg" border="0" alt="" /></a> </span></p>
<h1><span style="color:fuchsia;">__________________________________________________________________________</span></h1>
</div>]]></content:encoded>
</item>

</channel>
</rss>
