Sha256: 3a0673ee8ac4cc7624126b691e2bc2c0b4fde4b2136d6dbe63744a7151259db8

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path('../../fixtures/classes', __FILE__)

describe "Delegator#private_methods" do
  before :all do
    @simple = DelegateSpecs::Simple.new
    @delegate = DelegateSpecs::Delegator.new(@simple)
    @methods = @delegate.private_methods
  end

  ruby_version_is ""..."1.9" do
    it "does not include any method of the delegate object" do # since delegates does not forward private calls
      @methods.should_not include "priv"
      @methods.should_not include "prot"
      @methods.should_not include "pub"
    end

    it "includes all private instance methods of the Delegate class" do
      @methods.should include "extra_private"
    end
  end

  ruby_version_is "1.9" do
    it "does not include any method of the delegate object" do # since delegates does not forward private calls
      @methods.should_not include :priv
      @methods.should_not include :prot
      @methods.should_not include :pub
    end

    it "includes all private instance methods of the Delegate class" do
      @methods.should include :extra_private
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-delegate-2.0.1 spec/delegator/private_methods_spec.rb
rubysl-delegate-1.0.0 spec/delegator/private_methods_spec.rb
rubysl-delegate-2.0.0 spec/delegator/private_methods_spec.rb