Sha256: b1961b1ae6210c4dc163627fd270ca78b85337281ba662a8addceba80ecba9aa

Contents?: true

Size: 882 Bytes

Versions: 68

Compression:

Stored size: 882 Bytes

Contents

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

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

  it "should handle private_constant statement" do
    Registry.at('A::Foo').visibility.should == :private
    Registry.at('A::B').visibility.should == :private
    Registry.at('A::C').visibility.should == :private
  end

  it "should make all other constants public" do
    Registry.at('A::D').visibility.should == :public
  end

  it "should fail if parameter is not String, Symbol or Constant" do
    undoc_error 'class Foo; private_constant x; end'
    undoc_error 'class Foo; X = 1; private_constant X.new("hi"); end'
  end unless LEGACY_PARSER

  it "should fail if constant can't be recognized" do
    undoc_error 'class Foo2; private_constant :X end'
  end
end

Version data entries

68 entries across 52 versions & 7 rubygems

Version Path
yard-0.8.7 spec/handlers/private_constant_handler_spec.rb
challah-1.0.0 vendor/bundle/gems/yard-0.8.6.1/spec/handlers/private_constant_handler_spec.rb
yard-0.8.6.2 spec/handlers/private_constant_handler_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.5.2/spec/handlers/private_constant_handler_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.6/spec/handlers/private_constant_handler_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/yard-0.8.6.1/spec/handlers/private_constant_handler_spec.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/yard-0.8.6.1/spec/handlers/private_constant_handler_spec.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/yard-0.8.6.1/spec/handlers/private_constant_handler_spec.rb
yard-0.8.6.1 spec/handlers/private_constant_handler_spec.rb
challah-1.0.0.beta2 vendor/bundle/gems/yard-0.8.5.2/spec/handlers/private_constant_handler_spec.rb
challah-1.0.0.beta2 vendor/bundle/gems/yard-0.8.6/spec/handlers/private_constant_handler_spec.rb
yard-0.8.6 spec/handlers/private_constant_handler_spec.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.5.2/spec/handlers/private_constant_handler_spec.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/spec/handlers/private_constant_handler_spec.rb
yard-0.8.5.2 spec/handlers/private_constant_handler_spec.rb
yard-0.8.5.1 spec/handlers/private_constant_handler_spec.rb
yard-0.8.5 spec/handlers/private_constant_handler_spec.rb
challah-0.9.1.beta.3 vendor/bundle/gems/yard-0.8.3/spec/handlers/private_constant_handler_spec.rb
yard-0.8.4.1 spec/handlers/private_constant_handler_spec.rb
yard-0.8.4 spec/handlers/private_constant_handler_spec.rb