Sha256: af4d2f7a15e1194996fd2da2eb238d590eced8f478f140780d9f89c72bb5fc6d

Contents?: true

Size: 712 Bytes

Versions: 3

Compression:

Stored size: 712 Bytes

Contents

require File.dirname(__FILE__) + '/../../../spec_helper.rb'
require 'delegate'

module Bug10577
  class OCI8
    def describe(name)
      "Hello, #{name}"
    end

    def something(name)
      "Something, #{name}"
    end
  end

  class OCI8AutoRecover < DelegateClass(OCI8)
    def initialize
      @connection = OCI8.new
      super(@connection)
    end
  end

  class OCI8AutoRecover
    def describe(name)
      @connection.describe(name)
    end
  end

  describe Kernel do
    it "should not mask a delegate class' describe method" do
      bugger = OCI8AutoRecover.new
      bugger.describe('aslak').should == "Hello, aslak"
      bugger.something('aslak').should == "Something, aslak"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-1.0.6 spec/spec/runner/extensions/bug_report_10577_spec.rb
rspec-1.0.7 spec/spec/runner/extensions/bug_report_10577_spec.rb
rspec-1.0.8 spec/spec/runner/extensions/bug_report_10577_spec.rb