RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

Hash#fetch default value gotcha

I wrote a tiny blog post about Hash#fetch default value gotcha.

Comments

Right now proudly owning a completely new and trendy wanting replica rolex are certainly not only designed for the rich persons.They're now created luxurious and very affordable swiss replica watches to reach out to each spending plan and variety.You are able to just appreciate them by ordering replica watches on-line in which you have the total pleasure and real top quality at best possible rates.You are able to choose from the big variety of fake watches by comparing plenty of fantastic and gorgeous items.The end, top quality and models you receive from rolex replica watches are actually astonishing and also you will like them all.These rolex replica 2836 are outstanding and demonstrate to get amazing to suit your needs whilst it makes you jump out on the crowd.Distinctive variations and layouts of replica watch are actually out there to make your wrist stunning.These rolex replica 41mm could be great investments for yourself in extensive expression.zoujinhua - December 07, 2012 09:17
Excellent article! There's a related issue that can come up in Rspec tests: if you say `expect(some_method_call).to eq('hi')`, that works fine. But if you say `expect(some_method_call).to raise_error(SomeError)`, and it does raise that error, your test will fail! That's because the error is raised when the method is called, right there inside your `expect()` parentheses, before Ruby ever looks at the `.to raise_error` part.

Instead, you have to give it a block: `expect {some_method_call}.to raise_error`. That way it can hang onto that block, see that it's supposed to expect an error, then call it when it's ready and see what happens.NathanLong - December 07, 2012 14:36

Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!