This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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