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.7.5 spec/ruby_extensions_spec.rb
rconf-0.7.4 spec/ruby_extensions_spec.rb
rconf-0.7.3 spec/ruby_extensions_spec.rb
rconf-0.7.2 spec/ruby_extensions_spec.rb
rconf-0.7.1 spec/ruby_extensions_spec.rb
rconf-0.7.0 spec/ruby_extensions_spec.rb
rconf-0.6.35 spec/ruby_extensions_spec.rb
rconf-0.6.34 spec/ruby_extensions_spec.rb
rconf-0.6.33 spec/ruby_extensions_spec.rb
rconf-0.6.32 spec/ruby_extensions_spec.rb
rconf-0.6.31 spec/ruby_extensions_spec.rb
rconf-0.6.30 spec/ruby_extensions_spec.rb
rconf-0.6.25 spec/ruby_extensions_spec.rb
rconf-0.6.24 spec/ruby_extensions_spec.rb
rconf-0.6.23 spec/ruby_extensions_spec.rb
rconf-0.6.22 spec/ruby_extensions_spec.rb
rconf-0.6.21 spec/ruby_extensions_spec.rb
rconf-0.6.20 spec/ruby_extensions_spec.rb
rconf-0.6.19 spec/ruby_extensions_spec.rb
rconf-0.6.18 spec/ruby_extensions_spec.rb