# Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide. # # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use, # reproduction, modification, or disclosure of this program is # strictly prohibited. Any use of this program by an authorized # licensee is strictly subject to the terms and conditions, # including confidentiality obligations, set forth in the applicable # License Agreement between RightScale.com, Inc. and # the licensee require File.join(File.dirname(__FILE__), 'spec_helper') describe RightConf::Singleton do class Testy include RightConf::Singleton def testosterone 42 end def call_block(*args, &blk) blk.call end end it 'should forward class methods invokations to singleton instance' do Testy.testosterone.should == 42 Testy.instance.testosterone.should == 42 end it 'should also forward blocks' do Testy.call_block { 43 }.should == 43 end end