yard 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yard might be problematic. Click here for more details.

Files changed (107) hide show
  1. data/ChangeLog +341 -0
  2. data/LICENSE +1 -1
  3. data/README.md +31 -6
  4. data/Rakefile +22 -3
  5. data/docs/Tags.md +5 -1
  6. data/docs/WhatsNew.md +18 -1
  7. data/lib/rubygems_plugin.rb +3 -99
  8. data/lib/yard.rb +1 -1
  9. data/lib/yard/autoload.rb +37 -35
  10. data/lib/yard/cli/config.rb +25 -2
  11. data/lib/yard/cli/graph.rb +1 -1
  12. data/lib/yard/cli/yardoc.rb +4 -0
  13. data/lib/yard/code_objects/base.rb +17 -9
  14. data/lib/yard/code_objects/method_object.rb +0 -9
  15. data/lib/yard/code_objects/proxy.rb +6 -0
  16. data/lib/yard/docstring.rb +5 -0
  17. data/lib/yard/handlers/base.rb +3 -1
  18. data/lib/yard/handlers/processor.rb +1 -1
  19. data/lib/yard/handlers/ruby/alias_handler.rb +9 -8
  20. data/lib/yard/handlers/ruby/class_handler.rb +3 -3
  21. data/lib/yard/handlers/ruby/legacy/alias_handler.rb +9 -7
  22. data/lib/yard/handlers/ruby/legacy/method_handler.rb +7 -0
  23. data/lib/yard/handlers/ruby/legacy/private_constant_handler.rb +21 -0
  24. data/lib/yard/handlers/ruby/method_condition_handler.rb +1 -1
  25. data/lib/yard/handlers/ruby/method_handler.rb +7 -0
  26. data/lib/yard/handlers/ruby/private_constant_handler.rb +36 -0
  27. data/lib/yard/parser/ruby/ast_node.rb +41 -24
  28. data/lib/yard/parser/ruby/legacy/ruby_parser.rb +3 -0
  29. data/lib/yard/parser/ruby/legacy/statement.rb +2 -0
  30. data/lib/yard/parser/ruby/legacy/statement_list.rb +27 -4
  31. data/lib/yard/parser/ruby/ruby_parser.rb +71 -36
  32. data/lib/yard/parser/source_parser.rb +11 -10
  33. data/lib/yard/registry.rb +62 -24
  34. data/lib/yard/registry_store.rb +18 -5
  35. data/lib/yard/rubygems/doc_manager.rb +75 -0
  36. data/lib/yard/rubygems/specification.rb +23 -0
  37. data/lib/yard/serializers/process_serializer.rb +1 -1
  38. data/lib/yard/serializers/yardoc_serializer.rb +7 -2
  39. data/lib/yard/server/commands/display_object_command.rb +1 -1
  40. data/lib/yard/server/commands/library_command.rb +2 -2
  41. data/lib/yard/tags/default_factory.rb +1 -1
  42. data/lib/yard/tags/library.rb +2 -2
  43. data/lib/yard/templates/helpers/base_helper.rb +19 -0
  44. data/lib/yard/templates/helpers/html_helper.rb +22 -9
  45. data/lib/yard/templates/helpers/html_syntax_highlight_helper.rb +28 -0
  46. data/lib/yard/templates/helpers/markup_helper.rb +14 -22
  47. data/lib/yard/templates/template.rb +1 -1
  48. data/spec/cli/config_spec.rb +20 -0
  49. data/spec/cli/yardoc_spec.rb +12 -0
  50. data/spec/code_objects/base_spec.rb +13 -0
  51. data/spec/code_objects/proxy_spec.rb +9 -0
  52. data/spec/config_spec.rb +4 -1
  53. data/spec/docstring_spec.rb +5 -0
  54. data/spec/handlers/alias_handler_spec.rb +14 -1
  55. data/spec/handlers/attribute_handler_spec.rb +1 -1
  56. data/spec/handlers/base_spec.rb +21 -21
  57. data/spec/handlers/class_condition_handler_spec.rb +1 -1
  58. data/spec/handlers/class_handler_spec.rb +1 -1
  59. data/spec/handlers/class_variable_handler_spec.rb +1 -1
  60. data/spec/handlers/constant_handler_spec.rb +2 -2
  61. data/spec/handlers/examples/alias_handler_001.rb.txt +14 -0
  62. data/spec/handlers/examples/method_handler_001.rb.txt +6 -0
  63. data/spec/handlers/examples/module_handler_001.rb.txt +4 -0
  64. data/spec/handlers/examples/private_constant_handler_001.rb.txt +8 -0
  65. data/spec/handlers/exception_handler_spec.rb +1 -1
  66. data/spec/handlers/extend_handler_spec.rb +1 -1
  67. data/spec/handlers/method_condition_handler_spec.rb +1 -1
  68. data/spec/handlers/method_handler_spec.rb +7 -1
  69. data/spec/handlers/mixin_handler_spec.rb +1 -1
  70. data/spec/handlers/module_handler_spec.rb +5 -1
  71. data/spec/handlers/private_constant_handler_spec.rb +24 -0
  72. data/spec/handlers/process_handler_spec.rb +1 -1
  73. data/spec/handlers/ruby/base_spec.rb +4 -4
  74. data/spec/handlers/visibility_handler_spec.rb +1 -1
  75. data/spec/handlers/yield_handler_spec.rb +1 -1
  76. data/spec/parser/base_spec.rb +3 -5
  77. data/spec/parser/c_parser_spec.rb +1 -1
  78. data/spec/parser/ruby/ast_node_spec.rb +23 -26
  79. data/spec/parser/ruby/legacy/statement_list_spec.rb +9 -0
  80. data/spec/parser/ruby/ruby_parser_spec.rb +179 -177
  81. data/spec/parser/source_parser_spec.rb +41 -7
  82. data/spec/rake/yardoc_task_spec.rb +3 -3
  83. data/spec/registry_spec.rb +52 -0
  84. data/spec/registry_store_spec.rb +71 -1
  85. data/spec/serializers/yardoc_serializer_spec.rb +18 -7
  86. data/spec/server/rack_adapter_spec.rb +2 -2
  87. data/spec/spec_helper.rb +10 -0
  88. data/spec/tags/default_factory_spec.rb +122 -120
  89. data/spec/templates/helpers/base_helper_spec.rb +38 -14
  90. data/spec/templates/helpers/html_helper_spec.rb +19 -0
  91. data/spec/templates/helpers/html_syntax_highlight_helper_spec.rb +10 -6
  92. data/spec/templates/helpers/markup_helper_spec.rb +21 -5
  93. data/templates/default/class/dot/superklass.erb +1 -1
  94. data/templates/default/docstring/setup.rb +1 -1
  95. data/templates/default/fulldoc/html/css/style.css +12 -4
  96. data/templates/default/fulldoc/html/js/app.js +1 -1
  97. data/templates/default/fulldoc/html/js/jquery.js +5 -143
  98. data/templates/default/layout/html/files.erb +11 -0
  99. data/templates/default/layout/html/headers.erb +1 -1
  100. data/templates/default/layout/html/index.erb +2 -49
  101. data/templates/default/layout/html/listing.erb +4 -0
  102. data/templates/default/layout/html/objects.erb +32 -0
  103. data/templates/default/layout/html/setup.rb +1 -1
  104. data/templates/default/module/dot/info.erb +1 -1
  105. data/templates/default/module/dot/setup.rb +1 -1
  106. metadata +15 -6
  107. data/lib/yard/templates/helpers/html_syntax_highlight_helper18.rb +0 -25
@@ -145,7 +145,7 @@ module YARD
145
145
  end
146
146
 
147
147
  # Loads a template specified by path. If +:template+ or +:format+ is
148
- # specified in the {#options} hash, they are prependend and appended
148
+ # specified in the {#options} hash, they are prepended and appended
149
149
  # to the path respectively.
150
150
  #
151
151
  # @param [Array<String, Symbol>] path the path of the template
@@ -1,5 +1,7 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
+ require 'yaml'
4
+
3
5
  describe YARD::CLI::Config do
4
6
  before do
5
7
  @config = YARD::CLI::Config.new
@@ -38,6 +40,24 @@ describe YARD::CLI::Config do
38
40
  YARD::Config.options[:load_plugins].should == false
39
41
  end
40
42
 
43
+ it "should accept --as-list to force single item as list" do
44
+ run('--as-list', 'foo', 'bar')
45
+ YARD::Config.options[:foo].should == ['bar']
46
+ end
47
+
48
+ it "should accept --append to append values to existing key" do
49
+ YARD::Config.options[:foo] = ['bar']
50
+ run('--append', 'foo', 'baz', 'quux')
51
+ YARD::Config.options[:foo].should == ['bar', 'baz', 'quux']
52
+ run('-a', 'foo', 'last')
53
+ YARD::Config.options[:foo].should == ['bar', 'baz', 'quux', 'last']
54
+ end
55
+
56
+ it "should turn key into list if --append is used on single item" do
57
+ YARD::Config.options[:foo] = 'bar'
58
+ run('-a', 'foo', 'baz')
59
+ YARD::Config.options[:foo].should == ['bar', 'baz']
60
+ end
41
61
 
42
62
  it "should modify item if value is given" do
43
63
  run('foo', 'xxx')
@@ -84,6 +84,18 @@ describe YARD::CLI::Yardoc do
84
84
  end
85
85
  end
86
86
 
87
+ should_accept('--single-db') do |arg|
88
+ @yardoc.parse_arguments(arg)
89
+ Registry.single_object_db.should == true
90
+ Registry.single_object_db = nil
91
+ end
92
+
93
+ should_accept('--no-single-db') do |arg|
94
+ @yardoc.parse_arguments(arg)
95
+ Registry.single_object_db.should == false
96
+ Registry.single_object_db = nil
97
+ end
98
+
87
99
  should_accept('-c', '--use-cache') do |arg|
88
100
  @yardoc.parse_arguments(arg)
89
101
  @yardoc.use_cache.should == true
@@ -226,6 +226,12 @@ describe YARD::CodeObjects::Base do
226
226
  Registry.at('A::B').relative_path('A::C')
227
227
  end
228
228
 
229
+ it "should return full class name when objects share a common class prefix" do
230
+ YARD.parse_string "module User; end; module UserManager; end"
231
+ Registry.at('User').relative_path('UserManager').should == 'UserManager'
232
+ Registry.at('User').relative_path(Registry.at('UserManager')).should == 'UserManager'
233
+ end
234
+
229
235
  it "should return the relative path when they share a common namespace" do
230
236
  YARD.parse_string "module A; class B; end; class C; end; end"
231
237
  Registry.at('A::B').relative_path(Registry.at('A::C')).should == 'C'
@@ -281,6 +287,13 @@ describe YARD::CodeObjects::Base do
281
287
  o.docstring = '(see AnotherObject)'
282
288
  o.docstring.should == "FOO"
283
289
  end
290
+
291
+ it "should not copy docstring mid-docstring" do
292
+ doc = "Hello.\n(see file.rb)\nmore documentation"
293
+ o = ClassObject.new(:root, :Me)
294
+ o.docstring = doc
295
+ o.docstring.should == doc
296
+ end
284
297
 
285
298
  it "should allow extra docstring after (see Path)" do
286
299
  ClassObject.new(:root, :AnotherObject) {|x| x.docstring = "FOO" }
@@ -112,4 +112,13 @@ describe YARD::CodeObjects::Proxy do
112
112
  # Now it should resolve
113
113
  proxy.type.should == :module
114
114
  end
115
+
116
+
117
+ it "should handle constant names in namespaces" do
118
+ YARD.parse_string <<-eof
119
+ module A; end; B = A
120
+ module B::C; def foo; end end
121
+ eof
122
+ Proxy.new(:root, 'B::C').should == Registry.at('A::C')
123
+ end
115
124
  end
data/spec/config_spec.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), "spec_helper")
2
2
 
3
+ require 'yaml'
4
+
3
5
  describe YARD::Config do
4
6
  describe '.load' do
5
7
  before do
@@ -15,7 +17,7 @@ describe YARD::Config do
15
17
 
16
18
  it "should overwrite options with data in ~/.yard/config" do
17
19
  File.should_receive(:file?).with(YARD::Config::CONFIG_FILE).and_return(true)
18
- File.should_receive(:file?).with(YARD::Config::IGNORED_PLUGINS).and_return(true)
20
+ File.should_receive(:file?).with(YARD::Config::IGNORED_PLUGINS).and_return(false)
19
21
  YAML.should_receive(:load_file).with(YARD::Config::CONFIG_FILE).and_return({'test' => true})
20
22
  YARD::Config.load
21
23
  YARD::Config.options[:test].should be_true
@@ -90,6 +92,7 @@ describe YARD::Config do
90
92
  it "should load gem plugins if :load_plugins is true" do
91
93
  File.should_receive(:file?).with(CLI::Yardoc::DEFAULT_YARDOPTS_FILE).and_return(false)
92
94
  YARD::Config.stub!(:options).and_return(:load_plugins => true, :ignored_plugins => [], :autoload_plugins => [])
95
+ YARD::Config.stub!(:load_plugin)
93
96
  YARD::Config.should_receive(:require).with('rubygems')
94
97
  YARD::Config.load_plugins
95
98
  end
@@ -301,5 +301,10 @@ eof
301
301
  log.should_receive(:warn).with(/Unknown tag @hello$/)
302
302
  Docstring.new("@hello world")
303
303
  end
304
+
305
+ it "should not add trailing whitespace to freeform tags" do
306
+ doc = Docstring.new("@api private \t ")
307
+ doc.tag(:api).text.should == "private"
308
+ end
304
309
  end
305
310
  end
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}AliasHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}AliasHandler" do
4
4
  before(:all) { parse_file :alias_handler_001, __FILE__ }
5
5
 
6
6
  it "should throw alias into namespace object list" do
@@ -55,6 +55,19 @@ describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}AliasHandler" do
55
55
  P(:B).aliases[P('B#x2')].should == :do
56
56
  end
57
57
 
58
+ it "should handle quoted symbols" do
59
+ foo = Registry.at('A#foo')
60
+ foo.should_not be_nil
61
+ foo.should be_is_alias
62
+ Registry.at('A').aliases[foo].should == :a
63
+ end
64
+
65
+ it "should prepend aliases object's docstring to comments" do
66
+ Registry.at('D#a').tag(:return).types.should == ['Numeric']
67
+ Registry.at('D#b').tag(:return).types.should == ['String']
68
+ Registry.at('D#b').docstring.should == "Foo bar"
69
+ end
70
+
58
71
  it "should raise an UndocumentableError if only one parameter is passed" do
59
72
  undoc_error "alias_method :q"
60
73
  end
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}AttributeHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}AttributeHandler" do
4
4
  before(:all) { parse_file :attribute_handler_001, __FILE__ }
5
5
 
6
6
  def read_write(namespace, name, read, write, scope = :instance)
@@ -1,4 +1,5 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
+ require 'ostruct'
2
3
 
3
4
  include Parser
4
5
 
@@ -110,15 +111,15 @@ describe YARD::Handlers::Base do
110
111
  end
111
112
 
112
113
  describe '.in_file' do
113
- def parse(filename, src = "class A; end")
114
- parser = Parser::SourceParser.new
114
+ def parse(filename, parser_type, src = "class A; end")
115
+ parser = Parser::SourceParser.new(parser_type)
115
116
  parser.instance_variable_set("@file", filename)
116
117
  parser.parse(StringIO.new(src))
117
118
  end
118
119
 
119
- def create_handler(stmts)
120
+ def create_handler(stmts, parser_type)
120
121
  @@counter ||= 0
121
- sklass = Parser::SourceParser.parser_type == :ruby ? "Base" : "Legacy::Base"
122
+ sklass = parser_type == :ruby ? "Base" : "Legacy::Base"
122
123
  instance_eval(<<-eof)
123
124
  class ::InFileHandler#{@@counter += 1} < Handlers::Ruby::#{sklass}
124
125
  handles /^class/
@@ -128,46 +129,45 @@ describe YARD::Handlers::Base do
128
129
  eof
129
130
  end
130
131
 
131
- def test_handler(file, stmts, creates = true)
132
+ def test_handler(file, stmts, creates = true, parser_type = :ruby)
132
133
  Registry.clear
133
134
  Registry.at('#FOO').should be_nil
134
- create_handler(stmts)
135
- parse(file)
135
+ create_handler(stmts, parser_type)
136
+ parse(file, parser_type)
136
137
  Registry.at('#FOO').send(creates ? :should_not : :should, be_nil)
137
138
  Handlers::Base.subclasses.delete_if {|k,v| k.to_s =~ /^InFileHandler/ }
138
139
  end
139
140
 
140
141
  [:ruby, :ruby18].each do |parser_type|
141
- next if parser_type == :ruby && !RUBY19
142
+ next if parser_type == :ruby && LEGACY_PARSER
142
143
  describe "Parser type = #{parser_type.inspect}" do
143
- Parser::SourceParser.parser_type = parser_type
144
144
  it "should allow handler to be specific to a file" do
145
- test_handler 'file_a.rb', 'in_file "file_a.rb"', true
145
+ test_handler 'file_a.rb', 'in_file "file_a.rb"', true, parser_type
146
146
  end
147
-
147
+
148
148
  it "should ignore handler if filename does not match" do
149
- test_handler 'file_b.rb', 'in_file "file_a.rb"', false
149
+ test_handler 'file_b.rb', 'in_file "file_a.rb"', false, parser_type
150
150
  end
151
151
 
152
152
  it "should only test filename part when given a String" do
153
- test_handler '/path/to/file_a.rb', 'in_file "/to/file_a.rb"', false
153
+ test_handler '/path/to/file_a.rb', 'in_file "/to/file_a.rb"', false, parser_type
154
154
  end
155
-
155
+
156
156
  it "should test exact match for entire String" do
157
- test_handler 'file_a.rb', 'in_file "file"', false
157
+ test_handler 'file_a.rb', 'in_file "file"', false, parser_type
158
158
  end
159
159
 
160
160
  it "should allow a Regexp as argument and test against full path" do
161
- test_handler 'file_a.rbx', 'in_file /\.rbx$/', true
162
- test_handler '/path/to/file_a.rbx', 'in_file /\/to\/file_/', true
163
- test_handler '/path/to/file_a.rbx', 'in_file /^\/path/', true
161
+ test_handler 'file_a.rbx', 'in_file /\.rbx$/', true, parser_type
162
+ test_handler '/path/to/file_a.rbx', 'in_file /\/to\/file_/', true, parser_type
163
+ test_handler '/path/to/file_a.rbx', 'in_file /^\/path/', true, parser_type
164
164
  end
165
165
 
166
166
  it "should allow multiple in_file declarations" do
167
167
  stmts = 'in_file "x"; in_file /y/; in_file "foo.rb"'
168
- test_handler 'foo.rb', stmts, true
169
- test_handler 'xyzzy.rb', stmts, true
170
- test_handler 'x', stmts, true
168
+ test_handler 'foo.rb', stmts, true, parser_type
169
+ test_handler 'xyzzy.rb', stmts, true, parser_type
170
+ test_handler 'x', stmts, true, parser_type
171
171
  end
172
172
  end
173
173
  end
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ClassConditionHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ClassConditionHandler" do
4
4
  before(:all) { parse_file :class_condition_handler_001, __FILE__ }
5
5
 
6
6
  def verify_method(*names)
@@ -1,6 +1,6 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ClassHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ClassHandler" do
4
4
  before(:all) { parse_file :class_handler_001, __FILE__ }
5
5
 
6
6
  it "should parse a class block with docstring" do
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ClassVariableHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ClassVariableHandler" do
4
4
  before(:all) { parse_file :class_variable_handler_001, __FILE__ }
5
5
 
6
6
  it "should not parse class variables inside methods" do
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ConstantHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ConstantHandler" do
4
4
  before(:all) { parse_file :constant_handler_001, __FILE__ }
5
5
 
6
6
  it "should not parse constants inside methods" do
@@ -60,5 +60,5 @@ describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ConstantHandler" do
60
60
 
61
61
  it "should raise undocumentable error in 1.9 parser for Struct.new assignment to non-const" do
62
62
  undoc_error "nonconst = Struct.new"
63
- end if RUBY19
63
+ end unless LEGACY_PARSER
64
64
  end
@@ -12,6 +12,9 @@ module A
12
12
  alias * a
13
13
  alias for a
14
14
  alias ConstantName a
15
+
16
+ # Handle quoted symbols
17
+ alias :'foo' :'a'
15
18
  end
16
19
 
17
20
  class C
@@ -28,3 +31,14 @@ class B < C
28
31
  alias do x
29
32
  alias x2 do
30
33
  end
34
+
35
+ class D
36
+ # Foo bar
37
+ def a; "FOO" end
38
+
39
+ # @return [String]
40
+ alias b a
41
+
42
+ # @return [Numeric]
43
+ def a; 0 end
44
+ end
@@ -85,3 +85,9 @@ def CONST.meth_on_const; end
85
85
  CONST2 = CONST
86
86
  def CONST2.meth2_on_const; end
87
87
 
88
+ class D
89
+ alias b a
90
+
91
+ # foo bar
92
+ def a; end
93
+ end
@@ -13,6 +13,7 @@ module A; end
13
13
  module Q
14
14
  module A::B
15
15
  end
16
+ module FOO; end
16
17
  end
17
18
 
18
19
  module ::Kernel
@@ -23,3 +24,6 @@ module A; end
23
24
  module B; end
24
25
  module C; end
25
26
  class D; include A; include B; include C; end
27
+
28
+ Z = Q
29
+ module Z::FOO::A; end
@@ -0,0 +1,8 @@
1
+ module A
2
+ Foo = 1
3
+ class B; end
4
+ module C; end
5
+ module D; end
6
+
7
+ private_constant :Foo, 'B', C
8
+ end
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ExceptionHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ExceptionHandler" do
4
4
  before(:all) { parse_file :exception_handler_001, __FILE__ }
5
5
 
6
6
  it "should not document an exception outside of a method" do
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ExtendHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ExtendHandler" do
4
4
  before(:all) { parse_file :extend_handler_001, __FILE__ }
5
5
 
6
6
  it "should include modules at class scope" do
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}MethodConditionHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}MethodConditionHandler" do
4
4
  before(:all) { parse_file :method_condition_handler_001, __FILE__ }
5
5
 
6
6
  it "should not parse regular if blocks in methods" do
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}MethodHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}MethodHandler" do
4
4
  before(:all) do
5
5
  log.enter_level(Logger::ERROR) do
6
6
  parse_file :method_handler_001, __FILE__
@@ -132,4 +132,10 @@ describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}MethodHandler" do
132
132
  Registry.at('Foo.meth_on_const').should_not be_nil
133
133
  Registry.at('Foo.meth2_on_const').should_not be_nil
134
134
  end
135
+
136
+ it "should copy alias information on method (re-)definition to new method" do
137
+ Registry.at('D').aliases.should be_empty
138
+ Registry.at('D#b').is_alias?.should == false
139
+ Registry.at('D#a').is_alias?.should == false
140
+ end
135
141
  end
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}MixinHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}MixinHandler" do
4
4
  before(:all) { parse_file :mixin_handler_001, __FILE__ }
5
5
 
6
6
  it "should handle includes from classes or modules" do
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ModuleHandler" do
3
+ describe "YARD::Handlers::Ruby::#{LEGACY_PARSER ? "Legacy::" : ""}ModuleHandler" do
4
4
  before(:all) { parse_file :module_handler_001, __FILE__ }
5
5
 
6
6
  it "should parse a module block" do
@@ -27,4 +27,8 @@ describe "YARD::Handlers::Ruby::#{RUBY18 ? "Legacy::" : ""}ModuleHandler" do
27
27
  it "should list mixins in proper order" do
28
28
  Registry.at('D').mixins.should == [P(:C), P(:B), P(:A)]
29
29
  end
30
+
31
+ it "should create proper module when constant is in namespace" do
32
+ Registry.at('Q::FOO::A').should_not be_nil
33
+ end
30
34
  end