Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created March 20, 2009 00:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save patmaddox/82148 to your computer and use it in GitHub Desktop.
class Account
def initialize
@members = []
end
def add_member(m)
@members << m
end
def has_member?(m)
@members.include? m
end
end
describe Account, "has_member?" do
before(:each) do
@account = Account.new
end
it "should be false if it does not have the member" do
@account.should_not be_has_member(:foo)
end
it "should be true if it does have the member" do
@account.add_member :foo
@account.should have_member(:foo)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment