Sha256: 8339cdc60650487ae4dabe8d14bf9c2e6026275965edcddb16256489fda7c9f9

Contents?: true

Size: 1011 Bytes

Versions: 79

Compression:

Stored size: 1011 Bytes

Contents

# 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

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
rconf-0.9.18 spec/ruby_extensions_spec.rb
rconf-0.9.17 spec/ruby_extensions_spec.rb
rconf-0.9.12 spec/ruby_extensions_spec.rb
rconf-0.9.11 spec/ruby_extensions_spec.rb
rconf-0.9.10 spec/ruby_extensions_spec.rb
rconf-0.9.9 spec/ruby_extensions_spec.rb
rconf-0.9.8 spec/ruby_extensions_spec.rb
rconf-0.9.7 spec/ruby_extensions_spec.rb
rconf-0.9.6 spec/ruby_extensions_spec.rb
rconf-0.9.4 spec/ruby_extensions_spec.rb
rconf-0.8.30 spec/ruby_extensions_spec.rb
rconf-0.8.29 spec/ruby_extensions_spec.rb
rconf-0.8.21 spec/ruby_extensions_spec.rb
rconf-0.8.20 spec/ruby_extensions_spec.rb
rconf-0.8.19 spec/ruby_extensions_spec.rb
rconf-0.8.18 spec/ruby_extensions_spec.rb
rconf-0.8.17 spec/ruby_extensions_spec.rb
rconf-0.8.16 spec/ruby_extensions_spec.rb
rconf-0.8.15 spec/ruby_extensions_spec.rb
rconf-0.8.14 spec/ruby_extensions_spec.rb