Skip to content

Instantly share code, notes, and snippets.

@webdevotion
Created December 1, 2010 15:13
Show Gist options
  • Save webdevotion/723613 to your computer and use it in GitHub Desktop.
Save webdevotion/723613 to your computer and use it in GitHub Desktop.
working code for the "Rails 3 in action" ebook ( chapter 2 - section 2.3.1 )
class Bacon
attr_accessor :expired
def edible?
!expired
end
def expired!
self.expired = true
end
end
require 'spec_helper'
describe Bacon do
subject{Bacon.new}
its(:edible?) { should be_true }
it "expired!" do
subject.expired!
subject.should_not be_edible
end
end
require 'bacon'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment