Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Created October 16, 2008 11:47
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 jdelStrother/17115 to your computer and use it in GitHub Desktop.
Save jdelStrother/17115 to your computer and use it in GitHub Desktop.
describe '#instances' do
it 'should return all instances of a class currently present in the Ruby ObjectSpace' do
klass = Class.new
some_instances = [klass.new, klass.new, klass.new]
some_instances.each {|instance| klass.instances.should include(instance) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment