<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>OLD Bamboo Blog - Latest Comments in Defining interfaces through mocking</title><link>http://bambooblog.disqus.com/</link><description></description><atom:link href="https://bambooblog.disqus.com/defining_interfaces_through_mocking/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 02 Mar 2007 03:21:00 -0000</lastBuildDate><item><title>Re: Defining interfaces through mocking</title><link>http://blog.new-bamboo.co.uk/2007/02/25/defining-interfaces-through-mocking#comment-5778498</link><description>&lt;p&gt;Thanks for the great article.&lt;/p&gt;&lt;p&gt;I had to add the column 'owner' to the auction model to get the last test:&lt;br&gt;"context "An auction with an owner" do"&lt;br&gt;to pass.  Otherwise it was failing with no such method owner= for the auction model class.&lt;/p&gt;&lt;p&gt;Is this necessary or is there another way to get this test to pass?&lt;/p&gt;&lt;p&gt;Thanks.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anand Fox</dc:creator><pubDate>Fri, 02 Mar 2007 03:21:00 -0000</pubDate></item><item><title>Re: Defining interfaces through mocking</title><link>http://blog.new-bamboo.co.uk/2007/02/25/defining-interfaces-through-mocking#comment-5778497</link><description>&lt;p&gt;@james/@brian - Ah I knew I forgot something:)&lt;/p&gt;&lt;p&gt;@eric - Easy tiger, I'll get onto different expectation vocabulary together with more advanced parts of RSpec and use of mocking in the next article.:)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jonathan Conway</dc:creator><pubDate>Wed, 28 Feb 2007 07:19:00 -0000</pubDate></item><item><title>Re: Defining interfaces through mocking</title><link>http://blog.new-bamboo.co.uk/2007/02/25/defining-interfaces-through-mocking#comment-5778492</link><description>&lt;p&gt;Unless I missed something, in step 9 your last bit of code should be:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;br&gt;specify "should be able to deactivate auction" do&lt;br&gt;  @auction.attributes = AuctionSpecHelper.valid_auction_attributes&lt;br&gt;  @auction.deactivate!&lt;br&gt;  @auction.activated?.should_equal false&lt;br&gt;end&lt;br&gt;&lt;/code&gt;&lt;br&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James H.</dc:creator><pubDate>Tue, 27 Feb 2007 23:06:00 -0000</pubDate></item><item><title>Re: Defining interfaces through mocking</title><link>http://blog.new-bamboo.co.uk/2007/02/25/defining-interfaces-through-mocking#comment-5778490</link><description>&lt;p&gt;Mark, great introduction to Rspec and stubbing/mocking.  I have recently fallen for Rspec and stubbing because, as you said, it makes our interfaces better.&lt;/p&gt;&lt;p&gt;One thing that caught be attention were your expectations.  For instance:&lt;/p&gt;&lt;p&gt;@auction.valid?.should_equal false&lt;/p&gt;&lt;p&gt;Could be written like this:&lt;/p&gt;&lt;p&gt;@auction.should_not_be_valid&lt;/p&gt;&lt;p&gt;Rspec is clever enough (using method_missing) to run the method :valid? on the @auction object and make sure its false (because of the should_not).  I find its cleaner that way and it will also take advantage of Rspec's new generated spec names feature.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric ALlam</dc:creator><pubDate>Tue, 27 Feb 2007 22:51:00 -0000</pubDate></item><item><title>Re: Defining interfaces through mocking</title><link>http://blog.new-bamboo.co.uk/2007/02/25/defining-interfaces-through-mocking#comment-5778487</link><description>&lt;p&gt;OK, I missed the :save stub and only saw the :new_record one.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark Bennett</dc:creator><pubDate>Tue, 27 Feb 2007 16:53:00 -0000</pubDate></item><item><title>Re: Defining interfaces through mocking</title><link>http://blog.new-bamboo.co.uk/2007/02/25/defining-interfaces-through-mocking#comment-5778486</link><description>&lt;p&gt;You created a mock and a stub but you didn't use any of the capabilities of mocking except for creating a stub that you didn't use.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark Bennett</dc:creator><pubDate>Tue, 27 Feb 2007 16:44:00 -0000</pubDate></item><item><title>Re: Defining interfaces through mocking</title><link>http://blog.new-bamboo.co.uk/2007/02/25/defining-interfaces-through-mocking#comment-5778484</link><description>&lt;p&gt;I appreciate that you started all the way back at the 'gem install rspec'. This was a good intro for me. Thanks for taking the time to write it up. I look forward to pt 2.&lt;/p&gt;&lt;p&gt;One hiccup I ran into was that you never explicitly point out that we need to execute the migration. Of course, it's obvious now, but when you're focusing on shiny new things, the obvoius can go unnoticed :)&lt;/p&gt;&lt;p&gt;Anyway, if anyone else gets:&lt;/p&gt;&lt;p&gt;ActiveRecord::StatementInvalid in 'A general auction should have errors given invalid values'&lt;br&gt;ActiveRecord::StatementInvalid&lt;br&gt;./spec/models/auction_spec.rb:31:in `new'&lt;br&gt;./spec/models/auction_spec.rb:31:&lt;/p&gt;&lt;p&gt;just run 'rake db:migrate' and all becomes well.&lt;/p&gt;&lt;p&gt;Thanks again.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">BrianC</dc:creator><pubDate>Tue, 27 Feb 2007 15:03:00 -0000</pubDate></item></channel></rss>