Skip to content

Instantly share code, notes, and snippets.

@austinthecoder
Created February 26, 2013 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austinthecoder/5039018 to your computer and use it in GitHub Desktop.
Save austinthecoder/5039018 to your computer and use it in GitHub Desktop.
class Parser
def errors
@errors ||= []
end
end
describe Parser do
describe '#errors' do
it "is an empty list" do
subject.errors.should == []
end
it "always returns the same list" do
errors = subject.errors
subject.errors.should equal errors # tests that they're the same object
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment