Sha256: 7f7c9767d22f18dd99b83e5c669b8fd18f57b5f6d25c39709d13fab6e6c1dd09

Contents?: true

Size: 1.21 KB

Versions: 30

Compression:

Stored size: 1.21 KB

Contents

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

describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}VisibilityHandler" do
  before(:all) { parse_file :visibility_handler_001, __FILE__ }

  it "should be able to set visibility to public" do
    Registry.at("Testing#pub").visibility.should == :public
    Registry.at("Testing#pub2").visibility.should == :public
  end

  it "should be able to set visibility to private" do
    Registry.at("Testing#priv").visibility.should == :private
  end

  it "should be able to set visibility to protected" do
    Registry.at("Testing#prot").visibility.should == :protected
  end

  it "should support parameters and only set visibility on those methods" do
    Registry['Testing#notpriv'].visibility.should == :protected
    Registry['Testing#notpriv2'].visibility.should == :protected
    Registry['Testing#notpriv?'].visibility.should == :protected
  end

  it "should only accept strings and symbols" do
    Registry.at('Testing#name').should be_nil
    Registry.at('Testing#argument').should be_nil
    Registry.at('Testing#method_call').should be_nil
  end

  it "should handle constants passed in as symbols" do
    Registry.at('Testing#Foo').visibility.should == :private
  end
end

Version data entries

30 entries across 21 versions & 3 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/spec/handlers/visibility_handler_spec.rb
challah-0.9.1.beta.3 vendor/bundle/gems/yard-0.8.3/spec/handlers/visibility_handler_spec.rb
challah-0.9.1.beta vendor/bundle/gems/yard-0.8.3/spec/handlers/visibility_handler_spec.rb
challah-0.9.0 vendor/bundle/gems/yard-0.8.3/spec/handlers/visibility_handler_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.3/spec/handlers/visibility_handler_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.3/spec/handlers/visibility_handler_spec.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.3/spec/handlers/visibility_handler_spec.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
yard-0.8.3 spec/handlers/visibility_handler_spec.rb
challah-0.8.1 vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-rolls-0.1.0 vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-0.8.0.pre vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-0.7.1 vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-0.7.0 vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-0.7.0.pre2 vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb
challah-0.7.0.pre vendor/bundle/gems/yard-0.8.2.1/spec/handlers/visibility_handler_spec.rb