inch 0.5.0.rc5 → 0.5.0.rc6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -6
  3. data/.rubocop_todo.yml +40 -34
  4. data/Gemfile +3 -3
  5. data/Rakefile +10 -6
  6. data/bin/inch +5 -5
  7. data/config/base.rb +4 -4
  8. data/config/nodejs.rb +44 -1
  9. data/config/ruby.rb +1 -1
  10. data/inch.gemspec +17 -17
  11. data/lib/inch.rb +13 -13
  12. data/lib/inch/api.rb +10 -10
  13. data/lib/inch/api/compare.rb +2 -2
  14. data/lib/inch/api/compare/code_objects.rb +1 -1
  15. data/lib/inch/api/diff.rb +1 -1
  16. data/lib/inch/api/options/suggest.rb +1 -1
  17. data/lib/inch/api/suggest.rb +1 -1
  18. data/lib/inch/cli.rb +6 -6
  19. data/lib/inch/cli/command.rb +15 -15
  20. data/lib/inch/cli/command/base.rb +5 -3
  21. data/lib/inch/cli/command/base_list.rb +0 -1
  22. data/lib/inch/cli/command/console.rb +5 -5
  23. data/lib/inch/cli/command/diff.rb +6 -6
  24. data/lib/inch/cli/command/inspect.rb +5 -5
  25. data/lib/inch/cli/command/list.rb +4 -4
  26. data/lib/inch/cli/command/options/base.rb +17 -15
  27. data/lib/inch/cli/command/options/base_list.rb +17 -17
  28. data/lib/inch/cli/command/options/base_object.rb +1 -1
  29. data/lib/inch/cli/command/options/console.rb +13 -13
  30. data/lib/inch/cli/command/options/diff.rb +19 -19
  31. data/lib/inch/cli/command/options/inspect.rb +5 -5
  32. data/lib/inch/cli/command/options/list.rb +7 -7
  33. data/lib/inch/cli/command/options/show.rb +5 -5
  34. data/lib/inch/cli/command/options/stats.rb +2 -2
  35. data/lib/inch/cli/command/options/suggest.rb +12 -12
  36. data/lib/inch/cli/command/output/base.rb +1 -1
  37. data/lib/inch/cli/command/output/diff.rb +9 -9
  38. data/lib/inch/cli/command/output/inspect.rb +13 -13
  39. data/lib/inch/cli/command/output/list.rb +1 -1
  40. data/lib/inch/cli/command/output/show.rb +4 -4
  41. data/lib/inch/cli/command/output/stats.rb +14 -14
  42. data/lib/inch/cli/command/output/suggest.rb +14 -14
  43. data/lib/inch/cli/command/show.rb +4 -4
  44. data/lib/inch/cli/command/stats.rb +4 -4
  45. data/lib/inch/cli/command/suggest.rb +4 -4
  46. data/lib/inch/cli/command_parser.rb +4 -4
  47. data/lib/inch/cli/sparkline_helper.rb +1 -1
  48. data/lib/inch/cli/trace_helper.rb +1 -1
  49. data/lib/inch/cli/yardopts_helper.rb +1 -1
  50. data/lib/inch/code_object.rb +3 -3
  51. data/lib/inch/code_object/provider.rb +3 -3
  52. data/lib/inch/code_object/proxy.rb +3 -4
  53. data/lib/inch/codebase.rb +5 -5
  54. data/lib/inch/codebase/object.rb +2 -1
  55. data/lib/inch/codebase/serializer.rb +2 -2
  56. data/lib/inch/config.rb +6 -6
  57. data/lib/inch/config/codebase.rb +5 -5
  58. data/lib/inch/core_ext.rb +1 -1
  59. data/lib/inch/core_ext/string.rb +1 -1
  60. data/lib/inch/evaluation.rb +8 -8
  61. data/lib/inch/evaluation/proxy.rb +2 -3
  62. data/lib/inch/evaluation/role.rb +1 -1
  63. data/lib/inch/language/elixir/code_object/base.rb +6 -4
  64. data/lib/inch/language/elixir/evaluation/base.rb +2 -1
  65. data/lib/inch/language/elixir/evaluation/function_object.rb +1 -1
  66. data/lib/inch/language/elixir/import.rb +14 -14
  67. data/lib/inch/language/elixir/provider/reader.rb +1 -1
  68. data/lib/inch/language/elixir/provider/reader/docstring.rb +13 -0
  69. data/lib/inch/language/elixir/provider/reader/object.rb +5 -5
  70. data/lib/inch/language/elixir/provider/reader/object/base.rb +13 -5
  71. data/lib/inch/language/elixir/provider/reader/object/function_object.rb +1 -1
  72. data/lib/inch/language/elixir/provider/reader/parser.rb +21 -7
  73. data/lib/inch/language/elixir/roles/base.rb +3 -3
  74. data/lib/inch/language/elixir/roles/function.rb +2 -1
  75. data/lib/inch/language/elixir/roles/object.rb +1 -1
  76. data/lib/inch/language/nodejs/code_object/base.rb +199 -0
  77. data/lib/inch/language/nodejs/code_object/function_object.rb +74 -0
  78. data/lib/inch/language/nodejs/code_object/member_object.rb +11 -0
  79. data/lib/inch/language/nodejs/code_object/module_object.rb +23 -0
  80. data/lib/inch/language/nodejs/evaluation/base.rb +29 -0
  81. data/lib/inch/language/nodejs/evaluation/function_object.rb +31 -0
  82. data/lib/inch/language/nodejs/evaluation/member_object.rb +11 -0
  83. data/lib/inch/language/nodejs/evaluation/module_object.rb +27 -0
  84. data/lib/inch/language/nodejs/import.rb +17 -1
  85. data/lib/inch/language/nodejs/provider/jsdoc.rb +1 -1
  86. data/lib/inch/language/nodejs/provider/jsdoc/docstring.rb +13 -0
  87. data/lib/inch/language/nodejs/provider/jsdoc/object.rb +16 -8
  88. data/lib/inch/language/nodejs/provider/jsdoc/object/base.rb +82 -45
  89. data/lib/inch/language/nodejs/provider/jsdoc/object/function_object.rb +18 -0
  90. data/lib/inch/language/nodejs/provider/jsdoc/object/member_object.rb +15 -0
  91. data/lib/inch/language/nodejs/provider/jsdoc/object/module_object.rb +22 -0
  92. data/lib/inch/language/nodejs/provider/jsdoc/parser.rb +9 -10
  93. data/lib/inch/language/nodejs/roles/base.rb +32 -0
  94. data/lib/inch/language/nodejs/roles/function.rb +113 -0
  95. data/lib/inch/language/nodejs/roles/member.rb +13 -0
  96. data/lib/inch/language/nodejs/roles/module.rb +64 -0
  97. data/lib/inch/language/nodejs/roles/object.rb +76 -0
  98. data/lib/inch/language/ruby/code_object/base.rb +6 -4
  99. data/lib/inch/language/ruby/evaluation/base.rb +2 -1
  100. data/lib/inch/language/ruby/evaluation/method_object.rb +2 -1
  101. data/lib/inch/language/ruby/import.rb +24 -24
  102. data/lib/inch/language/ruby/provider/yard.rb +10 -10
  103. data/lib/inch/language/ruby/provider/yard/nodoc_helper.rb +2 -2
  104. data/lib/inch/language/ruby/provider/yard/object.rb +9 -9
  105. data/lib/inch/language/ruby/provider/yard/object/base.rb +25 -28
  106. data/lib/inch/language/ruby/provider/yard/object/method_object.rb +4 -3
  107. data/lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb +4 -3
  108. data/lib/inch/language/ruby/provider/yard/object/method_signature.rb +2 -2
  109. data/lib/inch/language/ruby/provider/yard/object/namespace_object.rb +2 -1
  110. data/lib/inch/language/ruby/provider/yard/parser.rb +2 -2
  111. data/lib/inch/language/ruby/roles/base.rb +1 -1
  112. data/lib/inch/language/ruby/roles/method.rb +2 -1
  113. data/lib/inch/language/ruby/roles/method_parameter.rb +1 -1
  114. data/lib/inch/language/ruby/roles/missing.rb +2 -2
  115. data/lib/inch/language/ruby/roles/object.rb +6 -6
  116. data/lib/inch/rake.rb +2 -2
  117. data/lib/inch/rake/suggest.rb +5 -5
  118. data/lib/inch/utils/code_location.rb +12 -0
  119. data/lib/inch/utils/read_write_methods.rb +2 -2
  120. data/lib/inch/utils/ui.rb +8 -8
  121. data/lib/inch/version.rb +1 -1
  122. data/test/fixtures/elixir/simple/all.json +321 -0
  123. data/test/integration/api/compare/codebases.rb +6 -6
  124. data/test/integration/cli/command/console_test.rb +13 -13
  125. data/test/integration/cli/command/diff_test.rb +12 -14
  126. data/test/integration/cli/command/inspect_test.rb +30 -30
  127. data/test/integration/cli/command/list_test.rb +34 -34
  128. data/test/integration/cli/command/show_test.rb +26 -26
  129. data/test/integration/cli/command/stats_test.rb +23 -23
  130. data/test/integration/cli/command/suggest_test.rb +58 -49
  131. data/test/integration/stats_options_test.rb +9 -9
  132. data/test/integration/visibility_options_test.rb +49 -45
  133. data/test/shared/base_list.rb +41 -41
  134. data/test/test_helper.rb +18 -10
  135. data/test/unit/api/filter_test.rb +9 -9
  136. data/test/unit/api/get_test.rb +6 -6
  137. data/test/unit/api/list_test.rb +3 -3
  138. data/test/unit/api/options/base_test.rb +6 -6
  139. data/test/unit/api/stats_test.rb +3 -3
  140. data/test/unit/api/suggest_test.rb +4 -4
  141. data/test/unit/cli/arguments_test.rb +25 -25
  142. data/test/unit/cli/command/base_test.rb +3 -3
  143. data/test/unit/cli/command/options/base_list_test.rb +14 -14
  144. data/test/unit/cli/command/options/base_object_test.rb +6 -6
  145. data/test/unit/cli/command/options/base_test.rb +3 -3
  146. data/test/unit/cli/command_parser_test.rb +29 -29
  147. data/test/unit/cli/trace_helper_test.rb +2 -2
  148. data/test/unit/cli/yardopts_helper_test.rb +35 -35
  149. data/test/unit/code_object/converter_test.rb +3 -3
  150. data/test/unit/code_object/provider_test.rb +2 -2
  151. data/test/unit/code_object/proxy_test.rb +11 -11
  152. data/test/unit/codebase/objects_test.rb +8 -8
  153. data/test/unit/codebase/proxy_test.rb +5 -5
  154. data/test/unit/config/codebase_test.rb +3 -3
  155. data/test/unit/config_test.rb +4 -4
  156. data/test/unit/evaluation/role_test.rb +8 -8
  157. data/test/unit/language/elixir/code_object/function_object_test.rb +35 -0
  158. data/test/unit/language/ruby/code_object/method_object_test.rb +128 -126
  159. data/test/unit/language/ruby/provider/yard/docstring_test.rb +27 -23
  160. data/test/unit/language/ruby/provider/yard/nodoc_helper_test.rb +21 -20
  161. data/test/unit/language/ruby/provider/yard/object/method_object_test.rb +20 -17
  162. data/test/unit/language/ruby/provider/yard_test.rb +4 -4
  163. data/test/unit/utils/buffered_ui_test.rb +20 -20
  164. data/test/unit/utils/ui_test.rb +20 -20
  165. data/test/unit/utils/weighted_list_test.rb +7 -7
  166. metadata +25 -2
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../../../../test_helper")
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../../../../test_helper')
2
2
 
3
3
  describe ::Inch::Language::Ruby::Provider::YARD::Docstring do
4
4
  let(:described_class) { ::Inch::Language::Ruby::Provider::YARD::Docstring }
@@ -7,7 +7,7 @@ describe ::Inch::Language::Ruby::Provider::YARD::Docstring do
7
7
  # loose TomDoc compatibility
8
8
  #
9
9
 
10
- it "should notice things in tomdoc style docs" do
10
+ it 'should notice things in tomdoc style docs' do
11
11
  text = <<-DOC
12
12
  Internal: Detects the Language of the blob.
13
13
 
@@ -32,7 +32,7 @@ Returns Language or nil.
32
32
  assert docstring.describes_return?
33
33
  end
34
34
 
35
- it "should notice things in tomdoc style docs 2" do
35
+ it 'should notice things in tomdoc style docs 2' do
36
36
  text = <<-DOC
37
37
  Public: Look up Language by one of its aliases.
38
38
 
@@ -55,7 +55,7 @@ Returns the Lexer or nil if none was found.
55
55
  assert docstring.describes_return?
56
56
  end
57
57
 
58
- it "should notice multi-line returns in tomdoc style docs" do
58
+ it 'should notice multi-line returns in tomdoc style docs' do
59
59
  text = <<-DOC
60
60
  Public: Look up Language by one of its aliases.
61
61
 
@@ -67,7 +67,7 @@ Returns the Lexer or nil
67
67
  assert docstring.describes_return?
68
68
  end
69
69
 
70
- it "should notice multi-line returns in tomdoc style docs 2" do
70
+ it 'should notice multi-line returns in tomdoc style docs 2' do
71
71
  text = <<-DOC
72
72
  Public: Look up Language by one of its aliases.
73
73
 
@@ -80,7 +80,7 @@ Returns the Lexer or nil
80
80
  assert docstring.describes_return?
81
81
  end
82
82
 
83
- it "should notice things in tomdoc style docs 3" do
83
+ it 'should notice things in tomdoc style docs 3' do
84
84
  text = <<-DOC
85
85
  Public: Look up Language by one of its aliases.
86
86
 
@@ -140,8 +140,8 @@ returns nothing
140
140
  end
141
141
 
142
142
  it "should understand 'Returns ...' with a visibility modifier in front of" \
143
- " it" do
144
- text = "Public: Returns the Integer color."
143
+ ' it' do
144
+ text = 'Public: Returns the Integer color.'
145
145
  docstring = described_class.new(text)
146
146
  assert docstring.mentions_return?
147
147
  assert docstring.describes_return?
@@ -151,7 +151,7 @@ returns nothing
151
151
  # PARAMETER MENTIONS
152
152
  #
153
153
 
154
- it "should work 2" do
154
+ it 'should work 2' do
155
155
  text = <<-DOC
156
156
  Just because format_html is mentioned here, does not mean
157
157
  the first parameter is mentioned.
@@ -161,7 +161,7 @@ the first parameter is mentioned.
161
161
  refute docstring.contains_code_example?
162
162
  end
163
163
 
164
- it "should work 2 if correct" do
164
+ it 'should work 2 if correct' do
165
165
  text = <<-DOC
166
166
  Just because format is mentioned here, does not mean
167
167
  the first parameter is meant.
@@ -175,7 +175,7 @@ the first parameter is meant.
175
175
  # CODE EXAMPLES
176
176
  #
177
177
 
178
- it "should work 3" do
178
+ it 'should work 3' do
179
179
  text = <<-DOC
180
180
  An example of a method using RDoc rather than YARD.
181
181
 
@@ -190,7 +190,8 @@ A string in the specified format.
190
190
  refute docstring.contains_code_example?
191
191
  end
192
192
 
193
- it "should work with code example" do
193
+ it 'should work with code example' do
194
+ # rubocop:disable Metrics/LineLength
194
195
  text = <<-DOC
195
196
  Another example.
196
197
 
@@ -201,6 +202,7 @@ Params:
201
202
  +param2+:: +Proc+ object that takes a pipe object as first and only param (may be nil)
202
203
  +param3+:: +Proc+ object that takes a pipe object as first and only param (may be nil)
203
204
  DOC
205
+ # rubocop:enable Metrics/LineLength
204
206
  docstring = described_class.new(text)
205
207
  assert docstring.contains_code_example?
206
208
  assert docstring.mentions_parameter?(:param1)
@@ -211,23 +213,25 @@ Params:
211
213
  assert docstring.describes_parameter?(:param3)
212
214
  end
213
215
 
214
- it "should recognize several parameter notations" do
216
+ it 'should recognize several parameter notations' do
217
+ # rubocop:disable Metrics/LineLength
215
218
  text = <<-DOC
216
219
  Params:
217
220
  +param1<String>+:: param1 line string to be executed by the system
218
221
  +param2<String,nil>+:: +Proc+ object that takes a pipe object as first and only param (may be nil)
219
222
  +param3<String|Class>+:: +Proc+ object that takes a pipe object as first and only param (may be nil)
220
223
  DOC
224
+ # rubocop:enable Metrics/LineLength
221
225
  docstring = described_class.new(text)
222
- assert docstring.mentions_parameter?(:param1), "should mention param1"
223
- assert docstring.mentions_parameter?(:param2), "should mention param2"
224
- assert docstring.mentions_parameter?(:param3), "should mention param3"
225
- assert docstring.describes_parameter?(:param1), "should describe param1"
226
- assert docstring.describes_parameter?(:param2), "should describe param2"
227
- assert docstring.describes_parameter?(:param3), "should describe param3"
226
+ assert docstring.mentions_parameter?(:param1), 'should mention param1'
227
+ assert docstring.mentions_parameter?(:param2), 'should mention param2'
228
+ assert docstring.mentions_parameter?(:param3), 'should mention param3'
229
+ assert docstring.describes_parameter?(:param1), 'should describe param1'
230
+ assert docstring.describes_parameter?(:param2), 'should describe param2'
231
+ assert docstring.describes_parameter?(:param3), 'should describe param3'
228
232
  end
229
233
 
230
- it "should work with code example 2" do
234
+ it 'should work with code example 2' do
231
235
  text = <<-DOC
232
236
  Just because format_html is mentioned here, does not mean
233
237
  the first parameter is mentioned.
@@ -240,7 +244,7 @@ the first parameter is mentioned.
240
244
  assert_equal 1, docstring.code_examples.size
241
245
  end
242
246
 
243
- it "should work with code example 3" do
247
+ it 'should work with code example 3' do
244
248
  text = <<-DOC
245
249
  An example of a method using RDoc rather than YARD.
246
250
 
@@ -260,7 +264,7 @@ A string in the specified format.
260
264
  assert docstring.describes_parameter?(:param1)
261
265
  end
262
266
 
263
- it "should work with multiple code examples" do
267
+ it 'should work with multiple code examples' do
264
268
  text = <<-DOC
265
269
  An example of a method using RDoc rather than YARD.
266
270
 
@@ -281,6 +285,6 @@ A string in the specified format.
281
285
  docstring = described_class.new(text)
282
286
  assert docstring.contains_code_example?
283
287
  assert_equal 2, docstring.code_examples.size
284
- assert docstring.code_examples.last.index("create_index! 2")
288
+ assert docstring.code_examples.last.index('create_index! 2')
285
289
  end
286
290
  end
@@ -1,38 +1,39 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../../../../test_helper")
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../../../../test_helper')
2
2
 
3
3
  describe ::Inch::Language::Ruby::Provider::YARD::NodocHelper do
4
4
  before do
5
5
  @config = Inch::Config.codebase
6
- @provider = ::Inch::Language::Ruby::Provider::YARD.parse(fixture_path(:ruby, :simple), @config)
6
+ @provider = ::Inch::Language::Ruby::Provider::YARD.parse(
7
+ fixture_path(:ruby, :simple), @config)
7
8
  @objects = @provider.objects
8
9
  end
9
10
 
10
- it "should return true for explicitly or implicitly tagged objects" do
11
+ it 'should return true for explicitly or implicitly tagged objects' do
11
12
  [
12
- "Foo::Qux",
13
- "Foo::Qux#method_with_implicit_nodoc",
14
- "Foo::Qux::Quux#method_with_private_tag",
15
- "Foo::Qux::Quux#method_with_explicit_nodoc",
16
- "Foo::Qux::Quux::PRIVATE_VALUE",
17
- "Foo::HiddenClass",
18
- "Foo::HiddenClass::EvenMoreHiddenClass",
19
- "Foo::HiddenClass::EvenMoreHiddenClass#method_with_implicit_nodoc",
20
- "Foo::HiddenClassViaTag",
21
- "Foo::HiddenClassViaTag#some_value"
13
+ 'Foo::Qux',
14
+ 'Foo::Qux#method_with_implicit_nodoc',
15
+ 'Foo::Qux::Quux#method_with_private_tag',
16
+ 'Foo::Qux::Quux#method_with_explicit_nodoc',
17
+ 'Foo::Qux::Quux::PRIVATE_VALUE',
18
+ 'Foo::HiddenClass',
19
+ 'Foo::HiddenClass::EvenMoreHiddenClass',
20
+ 'Foo::HiddenClass::EvenMoreHiddenClass#method_with_implicit_nodoc',
21
+ 'Foo::HiddenClassViaTag',
22
+ 'Foo::HiddenClassViaTag#some_value'
22
23
  ].each do |query|
23
24
  m = @objects.find { |o| o.fullname == query }
24
25
  assert m.nodoc?, "nodoc? should return true for #{query}"
25
26
  end
26
27
  end
27
28
 
28
- it "should return false for other objects" do
29
+ it 'should return false for other objects' do
29
30
  [
30
- "Foo::Qux::Quux#method_without_nodoc",
31
- "Foo::Qux::Quux::PUBLIC_VALUE",
32
- "Foo::Qux::DOCCED_VALUE",
33
- "Foo::HiddenClass::EvenMoreHiddenClass::SuddenlyVisibleClass",
34
- "Foo::HiddenClass::EvenMoreHiddenClass::SuddenlyVisibleClass" \
35
- "#method_with_implicit_doc"
31
+ 'Foo::Qux::Quux#method_without_nodoc',
32
+ 'Foo::Qux::Quux::PUBLIC_VALUE',
33
+ 'Foo::Qux::DOCCED_VALUE',
34
+ 'Foo::HiddenClass::EvenMoreHiddenClass::SuddenlyVisibleClass',
35
+ 'Foo::HiddenClass::EvenMoreHiddenClass::SuddenlyVisibleClass' \
36
+ '#method_with_implicit_doc'
36
37
  ].each do |query|
37
38
  m = @objects.find { |o| o.fullname == query }
38
39
  refute m.nodoc?, "nodoc? should return false for #{query}"
@@ -1,4 +1,5 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../../../../../test_helper")
1
+ require File.expand_path(File.dirname(__FILE__) +
2
+ '/../../../../../../test_helper')
2
3
 
3
4
  describe ::Inch::Language::Ruby::Provider::YARD::Parser do
4
5
  before do
@@ -8,18 +9,19 @@ describe ::Inch::Language::Ruby::Provider::YARD::Parser do
8
9
  @objects = @parser.objects
9
10
  end
10
11
 
11
- it "should work for Overloading#params_also_in_overloads" do
12
+ it 'should work for Overloading#params_also_in_overloads' do
12
13
  m = @objects.find do |o|
13
- o.fullname == "Overloading#params_also_in_overloads"
14
+ o.fullname == 'Overloading#params_also_in_overloads'
14
15
  end
15
16
 
16
17
  assert m.has_code_example?
17
18
 
18
19
  assert_equal 3, m.signatures.size
19
- assert_equal 2, m.parameters.size # at this moment, this counts all parameters in all overloaded signatures
20
+ # at this moment, this counts all parameters in all overloaded signatures
21
+ assert_equal 2, m.parameters.size
20
22
 
21
23
  signature = m.signatures[0]
22
- assert_equal "params_also_in_overloads(user_options = {})",
24
+ assert_equal 'params_also_in_overloads(user_options = {})',
23
25
  signature.signature
24
26
  assert_equal 1, signature.parameters.size
25
27
  refute signature.parameter(:user_options).nil?
@@ -27,62 +29,63 @@ describe ::Inch::Language::Ruby::Provider::YARD::Parser do
27
29
  assert signature.has_doc?
28
30
 
29
31
  signature = m.signatures[1]
30
- assert_equal "params_also_in_overloads()", signature.signature
32
+ assert_equal 'params_also_in_overloads()', signature.signature
31
33
  assert signature.parameters.empty?,
32
34
  "Should have been empty: #{signature.parameters.inspect}"
33
35
  assert signature.has_code_example?
34
36
  refute signature.has_doc?
35
37
 
36
38
  signature = m.signatures[2]
37
- assert_equal "params_also_in_overloads(transaction_id)", signature.signature
39
+ assert_equal 'params_also_in_overloads(transaction_id)', signature.signature
38
40
  assert_equal 1, signature.parameters.size
39
41
  refute signature.parameter(:transaction_id).nil?
40
42
  assert signature.has_code_example?
41
43
  refute signature.has_doc?
42
44
  end
43
45
 
44
- it "should work for Overloading#params_only_in_overloads" do
46
+ it 'should work for Overloading#params_only_in_overloads' do
45
47
  m = @objects.find do |o|
46
- o.fullname == "Overloading#params_only_in_overloads"
48
+ o.fullname == 'Overloading#params_only_in_overloads'
47
49
  end
48
50
 
49
51
  assert m.has_code_example?
50
52
 
51
53
  assert_equal 3, m.signatures.size
52
- assert_equal 2, m.parameters.size # at this moment, this counts all parameters in all overloaded signatures
54
+ # at this moment, this counts all parameters in all overloaded signatures
55
+ assert_equal 2, m.parameters.size
53
56
 
54
57
  signature = m.signatures[0]
55
- assert_equal "params_only_in_overloads()", signature.signature
58
+ assert_equal 'params_only_in_overloads()', signature.signature
56
59
  assert signature.parameters.empty?,
57
60
  "Should have been empty: #{signature.parameters.inspect}"
58
61
  assert signature.has_code_example?
59
62
  refute signature.has_doc?
60
63
 
61
64
  signature = m.signatures[1]
62
- assert_equal "params_only_in_overloads(transaction_id)", signature.signature
65
+ assert_equal 'params_only_in_overloads(transaction_id)', signature.signature
63
66
  assert_equal 1, signature.parameters.size
64
67
  refute signature.parameter(:transaction_id).nil?
65
68
  assert signature.has_code_example?
66
69
  refute signature.has_doc?
67
70
 
68
71
  signature = m.signatures[2]
69
- assert_equal "params_only_in_overloads(user_options)", signature.signature
72
+ assert_equal 'params_only_in_overloads(user_options)', signature.signature
70
73
  assert_equal 1, signature.parameters.size
71
74
  refute signature.parameter(:user_options).nil?
72
75
  assert signature.has_code_example?
73
76
  # assert signature.has_doc?
74
77
  end
75
78
 
76
- it "should work" do
79
+ it 'should work' do
77
80
  m = @objects.find do |o|
78
- o.fullname == "Foo::Bar#method_with_unstructured_doc"
81
+ o.fullname == 'Foo::Bar#method_with_unstructured_doc'
79
82
  end
80
83
  assert_equal 1, m.signatures.size
81
84
  assert_equal 1, m.parameters.size
82
85
  end
83
86
 
84
- it "should work 2" do
85
- m = @objects.find { |o| o.fullname == "Foo#method_with_splat_parameter" }
87
+ it 'should work 2' do
88
+ m = @objects.find { |o| o.fullname == 'Foo#method_with_splat_parameter' }
86
89
  assert_equal 1, m.signatures.size
87
90
  assert_equal 1, m.parameters.size
88
91
  end
@@ -1,16 +1,16 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../../../test_helper")
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../../../test_helper')
2
2
 
3
3
  describe ::Inch::Language::Ruby::Provider::YARD do
4
4
  let(:described_class) { ::Inch::Language::Ruby::Provider::YARD }
5
5
  let(:config) { ::Inch::Config.codebase }
6
6
 
7
- it "should parse" do
7
+ it 'should parse' do
8
8
  provider = described_class.parse(fixture_path(:ruby, :simple), config)
9
9
  assert !provider.objects.empty?
10
10
  end
11
11
 
12
- it "should parse too different codebases" do
13
- fullname = "Foo#b"
12
+ it 'should parse too different codebases' do
13
+ fullname = 'Foo#b'
14
14
 
15
15
  provider1 = described_class.parse(fixture_path(:ruby, :diff1), config)
16
16
  object1 = provider1.objects.find { |o| o.fullname == fullname }
@@ -1,48 +1,48 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
2
2
  require 'inch/utils/buffered_ui'
3
3
 
4
4
  describe ::Inch::Utils::BufferedUI do
5
5
  let(:described_class) { ::Inch::Utils::BufferedUI }
6
- it "should trace" do
6
+ it 'should trace' do
7
7
  out, err = capture_io do
8
8
  @instance = described_class.new
9
- @instance.trace("Test")
9
+ @instance.trace('Test')
10
10
  end
11
- assert out.empty?, "there should be output"
12
- assert err.empty?, "there should be no errors"
11
+ assert out.empty?, 'there should be output'
12
+ assert err.empty?, 'there should be no errors'
13
13
  refute @instance.buffer.empty?
14
14
  end
15
15
 
16
- it "should trace header" do
16
+ it 'should trace header' do
17
17
  out, err = capture_io do
18
18
  @instance = described_class.new
19
- @instance.header("Test", :red)
19
+ @instance.header('Test', :red)
20
20
  end
21
- assert out.empty?, "there should be output"
22
- assert err.empty?, "there should be no errors"
21
+ assert out.empty?, 'there should be output'
22
+ assert err.empty?, 'there should be no errors'
23
23
  refute @instance.buffer.empty?
24
24
  end
25
25
 
26
- it "should trace debug if ENV variable is set" do
27
- ENV["DEBUG"] = "1"
26
+ it 'should trace debug if ENV variable is set' do
27
+ ENV['DEBUG'] = '1'
28
28
  out, err = capture_io do
29
29
  @instance = described_class.new
30
- @instance.debug("Test")
30
+ @instance.debug('Test')
31
31
  end
32
- ENV["DEBUG"] = nil
33
- assert out.empty?, "there should be output"
34
- assert err.empty?, "there should be no errors"
32
+ ENV['DEBUG'] = nil
33
+ assert out.empty?, 'there should be output'
34
+ assert err.empty?, 'there should be no errors'
35
35
  refute @instance.buffer.empty?
36
36
  end
37
37
 
38
- it "should not trace debug if ENV variable is set" do
39
- refute ENV["DEBUG"]
38
+ it 'should not trace debug if ENV variable is set' do
39
+ refute ENV['DEBUG']
40
40
  out, err = capture_io do
41
41
  @instance = described_class.new
42
- @instance.debug("Test")
42
+ @instance.debug('Test')
43
43
  end
44
- assert out.empty?, "there should be no output"
45
- assert err.empty?, "there should be no errors"
44
+ assert out.empty?, 'there should be no output'
45
+ assert err.empty?, 'there should be no errors'
46
46
  assert @instance.buffer.empty?
47
47
  end
48
48
  end
@@ -1,42 +1,42 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../../test_helper")
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
2
2
 
3
3
  describe ::Inch::Utils::UI do
4
- it "should trace" do
4
+ it 'should trace' do
5
5
  out, err = capture_io do
6
6
  @instance = ::Inch::Utils::UI.new
7
- @instance.trace("Test")
7
+ @instance.trace('Test')
8
8
  end
9
- refute out.empty?, "there should be output"
10
- assert err.empty?, "there should be no errors"
9
+ refute out.empty?, 'there should be output'
10
+ assert err.empty?, 'there should be no errors'
11
11
  end
12
12
 
13
- it "should trace header" do
13
+ it 'should trace header' do
14
14
  out, err = capture_io do
15
15
  @instance = ::Inch::Utils::UI.new
16
- @instance.header("Test", :red)
16
+ @instance.header('Test', :red)
17
17
  end
18
- refute out.empty?, "there should be output"
19
- assert err.empty?, "there should be no errors"
18
+ refute out.empty?, 'there should be output'
19
+ assert err.empty?, 'there should be no errors'
20
20
  end
21
21
 
22
- it "should trace debug if ENV variable is set" do
23
- ENV["DEBUG"] = "1"
22
+ it 'should trace debug if ENV variable is set' do
23
+ ENV['DEBUG'] = '1'
24
24
  out, err = capture_io do
25
25
  @instance = ::Inch::Utils::UI.new
26
- @instance.debug("Test")
26
+ @instance.debug('Test')
27
27
  end
28
- ENV["DEBUG"] = nil
29
- refute out.empty?, "there should be output"
30
- assert err.empty?, "there should be no errors"
28
+ ENV['DEBUG'] = nil
29
+ refute out.empty?, 'there should be output'
30
+ assert err.empty?, 'there should be no errors'
31
31
  end
32
32
 
33
- it "should not trace debug if ENV variable is set" do
34
- refute ENV["DEBUG"]
33
+ it 'should not trace debug if ENV variable is set' do
34
+ refute ENV['DEBUG']
35
35
  out, err = capture_io do
36
36
  @instance = ::Inch::Utils::UI.new
37
- @instance.debug("Test")
37
+ @instance.debug('Test')
38
38
  end
39
- assert out.empty?, "there should be no output"
40
- assert err.empty?, "there should be no errors"
39
+ assert out.empty?, 'there should be no output'
40
+ assert err.empty?, 'there should be no errors'
41
41
  end
42
42
  end