RSpec

RSpec Presentation

This is a zip of my RSpec presentation from Desert Code Camp this past weekend.

It includes all of my slides in the PDF, plus all of the supporting code.

Enjoy!

RSpec
Ruby on Rails
Technology
coding
desertcodecamp

Comments (0)

Permalink

RSpec cheatsheet

I couldn’t remember where I got this from, so I am posting it here. If anyone can help me figure out where this comes from I would love to give proper credit.

RSpec Cheat Sheet

RSpec
Ruby on Rails
Technology
coding

Comments (0)

Permalink

Growl, Autotest and RSpec 1.0.8

So I’ve finally gotten myself a mac. Well, actually my boss got one for me, but you get the point. Anyways, my coworkers and I were having problems with Autotest, RSpec, and Growl before the recent release. However, since 1.0.8 is a new version, we decided to try again. So far it’s worked. So with a big thanks to Daniel Fischer, I’d like to write up how.

How-to

Here’s how. First, get your essentials:

  • Growl
  • growlnotify
  • Zentest
  • Rspec

Second, download the following pictures:
rspec-okay
rspec-fail
rspec-pending

Third, copy the following into your .autotest file:

module Autotest::Growl
  def self.growl title, msg, img, pri=0, stick=""
    system "growlnotify -n autotest --image #{img} -p #{pri} -m #{ msg.inspect} #{title} #{stick}"
  end

  Autotest.add_hook :ran_command do |autotest|
    output = autotest.results.grep(/\d+\s.*examples?/).last.slice(/(\d+)\s.*examples?,\s(\d+)\s.*failures?(?:,\s(\d+)\s.*pending)?/)
    if output =~ /[1-9]\sfailures?/
      growl "Test Results", "#{output}", "~/Library/autotest/rails_fail.png", 2, "-s"
    elsif output =~ /pending/
      growl "Test Results", "#{output}", "~/Library/autotest/rails_pending.png"
    else
      growl "Test Results", "#{output}", "~/Library/autotest/rails_ok.png"
    end
  end
end

If you don’t already have one. Just save it to ~/.autotest. Replace the three image locations with your downloaded ones, and you should be good to go!

RSpec
Ruby on Rails
Technology
coding
productivity

Comments (9)

Permalink