30 Aug '13, 12pm

Test Rake Tasks Like a BOSS #ruby #testing

jdclayton October 26, 2011 rails rake rspec testing Testing Rake tasks is one of the most painful things I do as a Ruby developer. Even after extracting all the code out into a separate class (which helps a lot), I still want to make sure I test that the right classes got called correctly with the right arguments. I wanted the subject to be the task, where I could call invoke , check its prerequisites, etc. describe "cron:hourly" do its(:prerequisites) { should include("reports:users") } end describe "reports:users" do before { ReportGenerator.stubs(:generate) } its(:prerequisites) { should include("environment") } it "generates the report" do subject.invoke ReportGenerator.should have_received(:generate).with() end end RSpec has shared contexts, so I set off to find an easy, straightforward way to test Rake tasks. # spec/support/shared_contexts/rake.rb require "rake" shar...

Full article: http://robots.thoughtbot.com/post/11957424161/test-rake-t...

Tweets

if u like one of these Adidas sneakers

twitter.com 31 Aug '13, 12pm

When you tweet with a location, Twitter stores that location. You can switch location on/off before each Tweet and always ...

Like a boss: Superstar, Davido flaunts his cust...

ynaija.com 30 Aug '13, 9am

Like a boss: Superstar, Davido flaunts his customized diamond encrusted Rolex watch (LOOK) Posted in wpzoom Celebrity on A...

if you like these custom LeBron X's.. #bestsnea...

twitter.com 01 Sep '13, 5pm

When you tweet with a location, Twitter stores that location. You can switch location on/off before each Tweet and always ...

"@isoolicious: bitches be like "new handbag"

twitter.com 01 Sep '13, 8pm

When you tweet with a location, Twitter stores that location. You can switch location on/off before each Tweet and always ...

#Singapore How to look like a K-pop star: We found some YouTube beauty tutorials so you can look just like you...

#Singapore How to look like a K-pop star: We fo...

shopping.insing.com 05 Sep '13, 8am

While some of us run the other direction at the mention of Kpop, there are a hoard of screaming others who welcome them wi...

[9JAOLOFOFO] Like A Boss: Superstar, Davido flaunts his customized diamond encrusted Rolex watch

[9JAOLOFOFO] Like A Boss: Superstar, Davido fla...

9jaolofofo.com.ng 30 Aug '13, 2pm

Superstar Davido really does know how to put his money where his mouth is. The “Skelewu” master is in the US for a few sho...

Return to the Backyard Tape Test

greenbuildingadvisor.com 30 Aug '13, 8am

As I wrote in the original article, “I peeled back about 3 inches of each tape to judge its tenacity. Some samples were so...

If you like it, you should put a ring on it

life-muse.blogspot.com 03 Sep '13, 3am

Sean and I both wore our rings everyday, from the day we got married. But we stopped wearing them like 2-3 years into our ...

Not sure this is a prize I'd like to win...

daisygreenmagazine.co.uk 02 Sep '13, 11am

Femmecup Ltd is giving three lucky readers the chance to win a Femmecup & Femmewash Gift Set . This fabulous set contains ...

Faster Test Suite Boot Times with Ruby on Rails...

java.sys-con.com 29 Aug '13, 2pm

Developers need to be able to run tests quickly or they will stop running them. The biggest bane of test driven developmen...