Sha256: bbecaa46e8b193782223f91b288ef83499d3a9523d27795b60669cd11a28c6e4

Contents?: true

Size: 1016 Bytes

Versions: 22

Compression:

Stored size: 1016 Bytes

Contents

# Copyright (C) 2011-2012 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

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rconf-1.0.13 spec/ruby_extensions_spec.rb
rconf-1.0.12 spec/ruby_extensions_spec.rb
rconf-1.0.11 spec/ruby_extensions_spec.rb
rconf-1.0.10 spec/ruby_extensions_spec.rb
rconf-1.0.9 spec/ruby_extensions_spec.rb
rconf-1.0.8 spec/ruby_extensions_spec.rb
rconf-1.0.7 spec/ruby_extensions_spec.rb
rconf-1.0.6 spec/ruby_extensions_spec.rb
rconf-1.0.5 spec/ruby_extensions_spec.rb
rconf-1.0.4 spec/ruby_extensions_spec.rb
rconf-1.0.3 spec/ruby_extensions_spec.rb
rconf-1.0.1 spec/ruby_extensions_spec.rb
rconf-1.0.0 spec/ruby_extensions_spec.rb
rconf-0.10.1 spec/ruby_extensions_spec.rb
rconf-0.10.0 spec/ruby_extensions_spec.rb
rconf-0.9.25 spec/ruby_extensions_spec.rb
rconf-0.9.24 spec/ruby_extensions_spec.rb
rconf-0.9.23 spec/ruby_extensions_spec.rb
rconf-0.9.22 spec/ruby_extensions_spec.rb
rconf-0.9.21 spec/ruby_extensions_spec.rb