Sha256: f140a2766da0c2e1f4dc74ccaddfc24301aced689bdf52439ea7ca1cfdd80616

Contents?: true

Size: 1.22 KB

Versions: 34

Compression:

Stored size: 1.22 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

34 entries across 34 versions & 4 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.5.3 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.5.2 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.5.1 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.5.0 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.4.1 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.4.0 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.3.5 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.3.4 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.3.3 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.3.2 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.3.1 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.3.0 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.2.1 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
challah-0.2.0 vendor/bundle/gems/yard-0.7.5/spec/handlers/visibility_handler_spec.rb
yard-0.7.5 spec/handlers/visibility_handler_spec.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/yard-0.7.4/spec/handlers/visibility_handler_spec.rb