Created
November 17, 2009 15:11
-
-
Save hgmnz/236963 to your computer and use it in GitHub Desktop.
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
include 'singleton' | |
class Configuration | |
include Singleton | |
def self.run | |
yield Configuration.instance | |
post_config_process | |
end | |
end |
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
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