Skip to content

Instantly share code, notes, and snippets.

@hgmnz
Created November 17, 2009 15:11
Show Gist options
  • Save hgmnz/236963 to your computer and use it in GitHub Desktop.
Save hgmnz/236963 to your computer and use it in GitHub Desktop.
include 'singleton'
class Configuration
include Singleton
def self.run
yield Configuration.instance
post_config_process
end
end
describe Configuration do
describe 'self.run' do
it 'yields the Configuration instance' do
lambda do
Configuration.run do |c|
#it yields the right thing
c.should == Configuration.instance
throw :it_yielded
end
end.should throw_symbol(:it_yielded) #proves it yielded
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment