inch 0.4.6 → 0.4.7

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 (143) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +15 -0
  3. data/.rubocop_todo.yml +113 -0
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +5 -2
  6. data/README.md +2 -2
  7. data/Rakefile +2 -2
  8. data/bin/inch +3 -2
  9. data/config/defaults.rb +7 -0
  10. data/inch.gemspec +7 -7
  11. data/lib/inch.rb +9 -10
  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 +2 -3
  15. data/lib/inch/api/compare/codebases.rb +1 -1
  16. data/lib/inch/api/diff.rb +6 -9
  17. data/lib/inch/api/options/base.rb +4 -4
  18. data/lib/inch/api/options/suggest.rb +1 -1
  19. data/lib/inch/api/stats.rb +0 -1
  20. data/lib/inch/api/suggest.rb +8 -9
  21. data/lib/inch/cli.rb +6 -6
  22. data/lib/inch/cli/command.rb +15 -15
  23. data/lib/inch/cli/command/base.rb +2 -2
  24. data/lib/inch/cli/command/console.rb +5 -5
  25. data/lib/inch/cli/command/diff.rb +7 -8
  26. data/lib/inch/cli/command/inspect.rb +5 -4
  27. data/lib/inch/cli/command/list.rb +4 -4
  28. data/lib/inch/cli/command/options/base.rb +8 -8
  29. data/lib/inch/cli/command/options/base_list.rb +9 -5
  30. data/lib/inch/cli/command/options/console.rb +4 -3
  31. data/lib/inch/cli/command/options/diff.rb +6 -4
  32. data/lib/inch/cli/command/options/inspect.rb +2 -2
  33. data/lib/inch/cli/command/options/list.rb +4 -3
  34. data/lib/inch/cli/command/options/show.rb +2 -2
  35. data/lib/inch/cli/command/options/stats.rb +2 -1
  36. data/lib/inch/cli/command/options/suggest.rb +6 -3
  37. data/lib/inch/cli/command/output/base.rb +2 -4
  38. data/lib/inch/cli/command/output/console.rb +4 -5
  39. data/lib/inch/cli/command/output/diff.rb +6 -6
  40. data/lib/inch/cli/command/output/inspect.rb +6 -8
  41. data/lib/inch/cli/command/output/list.rb +0 -1
  42. data/lib/inch/cli/command/output/show.rb +4 -5
  43. data/lib/inch/cli/command/output/stats.rb +21 -21
  44. data/lib/inch/cli/command/output/suggest.rb +28 -26
  45. data/lib/inch/cli/command/show.rb +4 -4
  46. data/lib/inch/cli/command/stats.rb +4 -4
  47. data/lib/inch/cli/command/suggest.rb +6 -6
  48. data/lib/inch/cli/command_parser.rb +6 -5
  49. data/lib/inch/cli/sparkline_helper.rb +2 -2
  50. data/lib/inch/cli/trace_helper.rb +1 -1
  51. data/lib/inch/cli/yardopts_helper.rb +4 -3
  52. data/lib/inch/code_object.rb +3 -3
  53. data/lib/inch/code_object/converter.rb +6 -8
  54. data/lib/inch/code_object/provider.rb +1 -1
  55. data/lib/inch/code_object/provider/yard.rb +10 -12
  56. data/lib/inch/code_object/provider/yard/docstring.rb +53 -21
  57. data/lib/inch/code_object/provider/yard/nodoc_helper.rb +3 -3
  58. data/lib/inch/code_object/provider/yard/object.rb +11 -9
  59. data/lib/inch/code_object/provider/yard/object/base.rb +33 -9
  60. data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +12 -0
  61. data/lib/inch/code_object/provider/yard/object/method_object.rb +36 -11
  62. data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +2 -2
  63. data/lib/inch/code_object/provider/yard/object/method_signature.rb +11 -8
  64. data/lib/inch/code_object/provider/yard/object/namespace_object.rb +1 -4
  65. data/lib/inch/code_object/provider/yard/parser.rb +2 -2
  66. data/lib/inch/code_object/proxy.rb +10 -9
  67. data/lib/inch/code_object/proxy/base.rb +8 -8
  68. data/lib/inch/code_object/proxy/class_variable_object.rb +8 -0
  69. data/lib/inch/code_object/proxy/method_object.rb +3 -2
  70. data/lib/inch/code_object/proxy/method_parameter_object.rb +1 -1
  71. data/lib/inch/codebase.rb +4 -5
  72. data/lib/inch/codebase/objects_filter.rb +2 -4
  73. data/lib/inch/codebase/serializer.rb +3 -3
  74. data/lib/inch/config.rb +2 -2
  75. data/lib/inch/config/base.rb +0 -1
  76. data/lib/inch/config/codebase.rb +3 -3
  77. data/lib/inch/core_ext.rb +1 -1
  78. data/lib/inch/core_ext/string.rb +1 -1
  79. data/lib/inch/evaluation.rb +16 -15
  80. data/lib/inch/evaluation/grade_list.rb +2 -2
  81. data/lib/inch/evaluation/object_schema.rb +1 -1
  82. data/lib/inch/evaluation/proxy.rb +8 -7
  83. data/lib/inch/evaluation/proxy/base.rb +12 -7
  84. data/lib/inch/evaluation/proxy/class_variable_object.rb +19 -0
  85. data/lib/inch/evaluation/proxy/constant_object.rb +1 -1
  86. data/lib/inch/evaluation/proxy/method_object.rb +12 -5
  87. data/lib/inch/evaluation/proxy/module_object.rb +1 -1
  88. data/lib/inch/evaluation/proxy/namespace_object.rb +1 -1
  89. data/lib/inch/evaluation/role/base.rb +1 -1
  90. data/lib/inch/evaluation/role/class_variable.rb +55 -0
  91. data/lib/inch/evaluation/role/method.rb +0 -1
  92. data/lib/inch/evaluation/role/method_parameter.rb +2 -1
  93. data/lib/inch/evaluation/role/object.rb +2 -2
  94. data/lib/inch/rake.rb +2 -2
  95. data/lib/inch/rake/suggest.rb +2 -2
  96. data/lib/inch/utils/shell_helper.rb +1 -1
  97. data/lib/inch/utils/ui.rb +5 -5
  98. data/lib/inch/utils/weighted_list.rb +2 -3
  99. data/lib/inch/version.rb +1 -1
  100. data/test/fixtures/simple/lib/broken.rb +35 -7
  101. data/test/fixtures/simple/lib/broken_ruby_2_0_features.rb +7 -0
  102. data/test/fixtures/simple/lib/directives.rb +8 -0
  103. data/test/fixtures/simple/lib/foo.rb +17 -0
  104. data/test/integration/api/compare/codebases.rb +1 -1
  105. data/test/integration/cli/command/console_test.rb +5 -5
  106. data/test/integration/cli/command/inspect_test.rb +4 -5
  107. data/test/integration/cli/command/list_test.rb +3 -4
  108. data/test/integration/cli/command/show_test.rb +4 -4
  109. data/test/integration/cli/command/stats_test.rb +2 -2
  110. data/test/integration/cli/command/suggest_test.rb +7 -7
  111. data/test/integration/stats_options_test.rb +3 -3
  112. data/test/integration/visibility_options_test.rb +13 -13
  113. data/test/shared/base_list.rb +4 -3
  114. data/test/test_helper.rb +16 -5
  115. data/test/unit/api/filter_test.rb +7 -7
  116. data/test/unit/api/get_test.rb +1 -1
  117. data/test/unit/api/list_test.rb +1 -1
  118. data/test/unit/api/options/base_test.rb +3 -3
  119. data/test/unit/api/stats_test.rb +1 -1
  120. data/test/unit/api/suggest_test.rb +3 -3
  121. data/test/unit/cli/arguments_test.rb +1 -1
  122. data/test/unit/cli/command/base_test.rb +1 -1
  123. data/test/unit/cli/command/options/base_list_test.rb +2 -2
  124. data/test/unit/cli/command/options/base_object_test.rb +1 -1
  125. data/test/unit/cli/command/options/base_test.rb +1 -1
  126. data/test/unit/cli/command_parser_test.rb +2 -2
  127. data/test/unit/cli/trace_helper_test.rb +1 -1
  128. data/test/unit/cli/yardopts_helper_test.rb +4 -3
  129. data/test/unit/code_object/converter_test.rb +1 -1
  130. data/test/unit/code_object/provider/yard/docstring_test.rb +105 -28
  131. data/test/unit/code_object/provider/yard/nodoc_helper_test.rb +5 -5
  132. data/test/unit/code_object/provider/yard/object/method_object_test.rb +20 -10
  133. data/test/unit/code_object/provider/yard_test.rb +4 -4
  134. data/test/unit/code_object/provider_test.rb +1 -1
  135. data/test/unit/code_object/proxy/method_object_test.rb +366 -262
  136. data/test/unit/code_object/proxy_test.rb +1 -1
  137. data/test/unit/codebase/objects_test.rb +2 -2
  138. data/test/unit/codebase/proxy_test.rb +1 -1
  139. data/test/unit/config/codebase_test.rb +1 -1
  140. data/test/unit/evaluation/role/base_test.rb +1 -1
  141. data/test/unit/utils/ui_test.rb +4 -4
  142. data/test/unit/utils/weighted_list_test.rb +7 -4
  143. metadata +12 -2
@@ -1,5 +1,5 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
2
- require File.expand_path(File.dirname(__FILE__) + '/../../../shared/base_list')
1
+ require File.expand_path(File.dirname(__FILE__) + "/../../../test_helper")
2
+ require File.expand_path(File.dirname(__FILE__) + "/../../../shared/base_list")
3
3
 
4
4
  describe ::Inch::CLI::Command::List do
5
5
  before do
@@ -11,7 +11,7 @@ describe ::Inch::CLI::Command::List do
11
11
 
12
12
  it "should run without args" do
13
13
  out, err = capture_io do
14
- @command.run()
14
+ @command.run
15
15
  end
16
16
  refute out.empty?, "there should be some output"
17
17
  assert err.empty?, "there should be no errors"
@@ -62,4 +62,3 @@ describe ::Inch::CLI::Command::List do
62
62
  assert err.empty?, "there should be no errors"
63
63
  end
64
64
  end
65
-
@@ -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::CLI::Command::Show do
4
4
  before do
@@ -8,7 +8,7 @@ describe ::Inch::CLI::Command::Show do
8
8
 
9
9
  it "should warn and exit when run without args" do
10
10
  out, err = capture_io do
11
- assert_raises(SystemExit) { @command.run() }
11
+ assert_raises(SystemExit) { @command.run }
12
12
  end
13
13
  assert out.empty?, "there should be no output"
14
14
  refute err.empty?, "there should be some error message"
@@ -44,14 +44,14 @@ describe ::Inch::CLI::Command::Show do
44
44
  end
45
45
 
46
46
  it "should output colored information" do
47
- out, err = capture_io do
47
+ out, _err = capture_io do
48
48
  @command.run("Foo::Bar#")
49
49
  end
50
50
  refute_equal out.uncolor, out, "should be colored"
51
51
  end
52
52
 
53
53
  it "should output uncolored information when asked" do
54
- out, err = capture_io do
54
+ out, _err = capture_io do
55
55
  @command.run("Foo::Bar#", "--no-color")
56
56
  end
57
57
  assert_equal out.uncolor, out, "should not be colored"
@@ -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::CLI::Command::Stats do
4
4
  before do
@@ -8,7 +8,7 @@ describe ::Inch::CLI::Command::Stats do
8
8
 
9
9
  it "should run without args" do
10
10
  out, err = capture_io do
11
- @command.run()
11
+ @command.run
12
12
  end
13
13
  refute out.empty?, "there should be some output"
14
14
  assert err.empty?, "there should be no errors"
@@ -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::CLI::Command::Suggest do
4
4
  before do
@@ -8,7 +8,7 @@ describe ::Inch::CLI::Command::Suggest do
8
8
 
9
9
  it "should run without args" do
10
10
  out, err = capture_io do
11
- @command.run()
11
+ @command.run
12
12
  end
13
13
  refute out.empty?, "there should be some output"
14
14
  assert err.empty?, "there should be no errors"
@@ -37,13 +37,13 @@ describe ::Inch::CLI::Command::Suggest do
37
37
  end
38
38
 
39
39
  it "should run with non-existing filelist in args" do
40
- out, err = capture_io do
40
+ _out, _err = capture_io do
41
41
  @command.run("app/**/*.rb")
42
42
  end
43
43
  # TODO: not sure what should actually happen here:
44
44
  # no output or error message?
45
- #assert out.empty?, "there should be no output"
46
- #assert err.empty?, "there should be no errors"
45
+ # assert out.empty?, "there should be no output"
46
+ # assert err.empty?, "there should be no errors"
47
47
  end
48
48
 
49
49
  it "should run with --objects switch" do
@@ -58,7 +58,7 @@ describe ::Inch::CLI::Command::Suggest do
58
58
  end
59
59
 
60
60
  it "should give error when run with --unknown-switch" do
61
- out, err = capture_io do
61
+ _out, _err = capture_io do
62
62
  assert_raises(SystemExit) { @command.run("--unknown-switch") }
63
63
  end
64
64
  end
@@ -86,7 +86,7 @@ describe ::Inch::CLI::Command::Suggest do
86
86
  it "should run without args on really good fixture" do
87
87
  out, err = capture_io do
88
88
  Dir.chdir fixture_path(:really_good)
89
- @command.run()
89
+ @command.run
90
90
  end
91
91
  refute out.empty?, "there should be some output"
92
92
  assert err.empty?, "there should be no errors"
@@ -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
  #
4
4
  # These format tests also broke things in the regular testsuite.
@@ -20,13 +20,13 @@ describe ::Inch::CLI::Command::List do
20
20
  end
21
21
 
22
22
  it "should run with --no-private switch" do
23
- out = %x|#{@command} --format json|
23
+ out = `#{@command} --format json`
24
24
  refute out.empty?, "there should be some output"
25
25
  assert_parsed_output JSON[out]
26
26
  end
27
27
 
28
28
  it "should run with --no-protected switch" do
29
- out = %x|#{@command} --format yaml|
29
+ out = `#{@command} --format yaml`
30
30
  refute out.empty?, "there should be some output"
31
31
  assert_parsed_output YAML.load(out)
32
32
  end
@@ -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::CLI::Command do
4
4
  before do
@@ -7,7 +7,7 @@ describe ::Inch::CLI::Command do
7
7
  end
8
8
 
9
9
  it "should run without visibility switches" do
10
- out, err = capture_io do
10
+ out, _err = capture_io do
11
11
  @command.run("--all")
12
12
  end
13
13
  refute out.empty?, "there should be some output"
@@ -18,7 +18,7 @@ describe ::Inch::CLI::Command do
18
18
  end
19
19
 
20
20
  it "should run with --no-protected switch" do
21
- out, err = capture_io do
21
+ out, _err = capture_io do
22
22
  @command.run("--all", "--no-protected")
23
23
  end
24
24
  refute out.empty?, "there should be some output"
@@ -29,8 +29,8 @@ describe ::Inch::CLI::Command do
29
29
  end
30
30
 
31
31
  it "should run with --no-public switch" do
32
- out, err = capture_io do
33
- @command.run(*%w|--all --no-public|)
32
+ out, _err = capture_io do
33
+ @command.run(*%w(--all --no-public))
34
34
  end
35
35
  refute out.empty?, "there should be some output"
36
36
  refute_match /\bFoo#public_method\b/, out
@@ -40,8 +40,8 @@ describe ::Inch::CLI::Command do
40
40
  end
41
41
 
42
42
  it "should run with --no-public --no-protected switch" do
43
- out, err = capture_io do
44
- @command.run(*%w|--all --no-public --no-protected|)
43
+ out, _err = capture_io do
44
+ @command.run(*%w(--all --no-public --no-protected))
45
45
  end
46
46
  assert out.empty?, "there should be no output"
47
47
  refute_match /\bFoo#public_method\b/, out
@@ -51,8 +51,8 @@ describe ::Inch::CLI::Command do
51
51
  end
52
52
 
53
53
  it "should run with --no-public --no-protected --private switch" do
54
- out, err = capture_io do
55
- @command.run(*%w|--all --no-public --no-protected --private|)
54
+ out, _err = capture_io do
55
+ @command.run(*%w(--all --no-public --no-protected --private))
56
56
  end
57
57
  refute out.empty?, "there should be some output"
58
58
  refute_match /\bFoo#public_method\b/, out
@@ -62,8 +62,8 @@ describe ::Inch::CLI::Command do
62
62
  end
63
63
 
64
64
  it "should run with --no-public switch" do
65
- out, err = capture_io do
66
- @command.run(*%w|--all --no-public|)
65
+ out, _err = capture_io do
66
+ @command.run(*%w(--all --no-public))
67
67
  end
68
68
  refute out.empty?, "there should be some output"
69
69
  refute_match /\bFoo#public_method\b/, out
@@ -73,8 +73,8 @@ describe ::Inch::CLI::Command do
73
73
  end
74
74
 
75
75
  it "should run with --no-protected switch" do
76
- out, err = capture_io do
77
- @command.run(*%w|--all --no-protected|)
76
+ out, _err = capture_io do
77
+ @command.run(*%w(--all --no-protected))
78
78
  end
79
79
  refute out.empty?, "there should be some output"
80
80
  assert_match /\bFoo#public_method\b/, out
@@ -3,8 +3,10 @@ module Shared
3
3
  extend Minitest::Spec::DSL
4
4
 
5
5
  it "should give error when run with --unknown-switch" do
6
- out, err = capture_io do
7
- assert_raises(SystemExit) { @command.run("lib/foo.rb", "--unknown-switch") }
6
+ _out, _err = capture_io do
7
+ assert_raises(SystemExit) do
8
+ @command.run("lib/foo.rb", "--unknown-switch")
9
+ end
8
10
  end
9
11
  end
10
12
 
@@ -43,7 +45,6 @@ module Shared
43
45
  assert_match /\bFoo::Bar#/, out
44
46
  end
45
47
 
46
-
47
48
  it "should run with --only-undocumented switch" do
48
49
  skip
49
50
  out, err = capture_io do
@@ -1,11 +1,12 @@
1
- require 'simplecov'
1
+ require "simplecov"
2
2
 
3
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
4
4
 
5
- require 'minitest/autorun'
6
- require 'bundler'
5
+ require "minitest/autorun"
6
+ require "bundler"
7
7
  Bundler.require
8
- require 'inch'
8
+ require "inch"
9
+ require "inch/cli"
9
10
 
10
11
  def assert_roles(object, expected, unexpected)
11
12
  roles = object.roles.map(&:class)
@@ -17,6 +18,16 @@ def assert_roles(object, expected, unexpected)
17
18
  end
18
19
  end
19
20
 
21
+ def count_roles(object, role_class, object_name = nil)
22
+ find_roles(object, role_class, object_name).size
23
+ end
24
+
25
+ def find_roles(object, role_class, object_name = nil)
26
+ object.roles.select do |r|
27
+ r.class == role_class && (object_name.nil? || r.object.name == object_name)
28
+ end
29
+ end
30
+
20
31
  def fixture_path(name)
21
32
  File.join(File.dirname(__FILE__), "fixtures", name.to_s)
22
33
  end
@@ -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::API::Filter do
4
4
  before do
@@ -13,37 +13,37 @@ describe ::Inch::API::Filter do
13
13
  end
14
14
 
15
15
  it "should work with option: visibility == :public" do
16
- @options = {:visibility => [:public]}
16
+ @options = { visibility: [:public] }
17
17
  @context = ::Inch::API::Filter.new @codebase, @options
18
18
  assert @context.objects.all? { |o| o.public? }
19
19
  end
20
20
 
21
21
  it "should work with option: visibility == :protected" do
22
- @options = {:visibility => [:protected]}
22
+ @options = { visibility: [:protected] }
23
23
  @context = ::Inch::API::Filter.new @codebase, @options
24
24
  assert @context.objects.all? { |o| o.protected? }
25
25
  end
26
26
 
27
27
  it "should work with option: visibility == :private" do
28
- @options = {:visibility => [:private]}
28
+ @options = { visibility: [:private] }
29
29
  @context = ::Inch::API::Filter.new @codebase, @options
30
30
  assert @context.objects.all? { |o| o.private? || o.tagged_as_private? }
31
31
  end
32
32
 
33
33
  it "should work with option: namespaces == :only" do
34
- @options = {:namespaces => :only}
34
+ @options = { namespaces: :only }
35
35
  @context = ::Inch::API::Filter.new @codebase, @options
36
36
  assert @context.objects.all? { |o| o.namespace? }
37
37
  end
38
38
 
39
39
  it "should work with option: undocumented == :only" do
40
- @options = {:undocumented => :only}
40
+ @options = { undocumented: :only }
41
41
  @context = ::Inch::API::Filter.new @codebase, @options
42
42
  assert @context.objects.all? { |o| o.undocumented? }
43
43
  end
44
44
 
45
45
  it "should work with option: depth == 2" do
46
- @options = {:depth => 2}
46
+ @options = { depth: 2 }
47
47
  @context = ::Inch::API::Filter.new @codebase, @options
48
48
  refute @context.objects.any? { |o| o.depth > 2 }
49
49
  end
@@ -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::API::Get do
4
4
  before do
@@ -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::API::List do
4
4
  before do
@@ -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::API::Options::Base do
4
4
  class APIOptionsTest < ::Inch::API::Options::Base
@@ -8,7 +8,7 @@ describe ::Inch::API::Options::Base do
8
8
  end
9
9
 
10
10
  it "should work with a Hash or Struct" do
11
- @options_hash = {:foo => "foo", :baz => 42}
11
+ @options_hash = { foo: "foo", baz: 42 }
12
12
  @options_struct = OpenStruct.new(@options_hash)
13
13
 
14
14
  @options1 = APIOptionsTest.new @options_hash
@@ -21,7 +21,7 @@ describe ::Inch::API::Options::Base do
21
21
  end
22
22
 
23
23
  it "should return default values" do
24
- @options_hash = {:baz => 42}
24
+ @options_hash = { baz: 42 }
25
25
  @options = APIOptionsTest.new @options_hash
26
26
 
27
27
  assert_equal :bar, @options.foo
@@ -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::API::Stats do
4
4
  before do
@@ -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::API::Suggest do
4
4
  before do
@@ -13,10 +13,10 @@ describe ::Inch::API::Suggest do
13
13
  end
14
14
 
15
15
  it "should work with option: object_count" do
16
- @options = {:object_count => 10}
16
+ @options = { object_count: 10 }
17
17
  @context = ::Inch::API::Suggest.new @codebase, @options
18
18
 
19
- @options2 = {:object_count => 20}
19
+ @options2 = { object_count: 20 }
20
20
  @context2 = ::Inch::API::Suggest.new @codebase, @options2
21
21
 
22
22
  assert_equal 10, @context.objects.size
@@ -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::CLI::Arguments do
4
4
  before do
@@ -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::CLI::Command::Console do
4
4
  before do
@@ -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::CLI::Command::Options::BaseList do
4
4
  it "should run parse without errors" do
@@ -10,7 +10,7 @@ describe ::Inch::CLI::Command::Options::BaseList do
10
10
  assert @options.undocumented.nil?
11
11
  assert @options.depth.nil?
12
12
  end
13
-
13
+
14
14
  it "should run parse twice without affecting the second run" do
15
15
  @options = ::Inch::CLI::Command::Options::BaseList.new
16
16
  @options.parse(["--no-public", "--no-protected", "--private"])
@@ -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::CLI::Command::Options::BaseObject do
4
4
  it "should run parse without errors" do
@@ -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::CLI::Command::Options::Base do
4
4
  it "should run parse without errors" do
@@ -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::CLI::CommandParser do
4
4
  before do
@@ -8,7 +8,7 @@ describe ::Inch::CLI::CommandParser do
8
8
 
9
9
  it "should run without args" do
10
10
  out, err = capture_io do
11
- @command = @command_parser.run()
11
+ @command = @command_parser.run
12
12
  end
13
13
  refute out.empty?, "there should be some output"
14
14
  assert err.empty?, "there should be no errors"
@@ -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
  class Tracer
4
4
  include ::Inch::CLI::TraceHelper