polishgeeks-dev-tools 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +3 -2
  4. data/CHANGELOG.md +69 -0
  5. data/Gemfile.lock +76 -81
  6. data/README.md +28 -22
  7. data/Rakefile +4 -3
  8. data/config/rubocop.yml +16 -16
  9. data/config/rubocop_todo.yml +14 -0
  10. data/lib/polish_geeks/dev_tools.rb +26 -0
  11. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/allowed_extensions.rb +4 -4
  12. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/base.rb +18 -3
  13. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/brakeman.rb +5 -2
  14. data/lib/polish_geeks/dev_tools/commands/bundler_audit.rb +23 -0
  15. data/lib/{polishgeeks/dev-tools/commands/empty_method.rb → polish_geeks/dev_tools/commands/empty_methods.rb} +3 -13
  16. data/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/file_parser.rb +1 -1
  17. data/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/string_refinements.rb +2 -2
  18. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/examples_comparator.rb +13 -7
  19. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/expires_in.rb +6 -6
  20. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/final_blank_line.rb +1 -11
  21. data/lib/polish_geeks/dev_tools/commands/gemfile.rb +39 -0
  22. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/haml_lint.rb +0 -0
  23. data/lib/polish_geeks/dev_tools/commands/required_files.rb +38 -0
  24. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec.rb +24 -5
  25. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_names.rb +1 -1
  26. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_structure.rb +22 -9
  27. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rubocop.rb +10 -8
  28. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rubycritic.rb +0 -0
  29. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/simplecov.rb +0 -0
  30. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/tasks_files_names.rb +0 -0
  31. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yard.rb +0 -0
  32. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yml_parser.rb +0 -0
  33. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/config.rb +24 -16
  34. data/lib/polish_geeks/dev_tools/config_manager.rb +68 -0
  35. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/errors.rb +0 -0
  36. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/hash.rb +0 -0
  37. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/logger.rb +3 -3
  38. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/output_storer.rb +0 -0
  39. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/runner.rb +0 -0
  40. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/shell.rb +0 -0
  41. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/tasks/dev-tools.rake +0 -0
  42. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/base.rb +2 -2
  43. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/rails.rb +0 -0
  44. data/lib/polish_geeks/dev_tools/validators/rubocop.rb +12 -0
  45. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/simplecov.rb +1 -1
  46. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/version.rb +1 -1
  47. data/lib/polishgeeks-dev-tools.rb +6 -31
  48. data/polishgeeks_dev_tools.gemspec +6 -5
  49. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/allowed_extensions_spec.rb +5 -17
  50. data/spec/lib/polish_geeks/dev_tools/commands/base_spec.rb +90 -0
  51. data/spec/lib/polish_geeks/dev_tools/commands/brakeman_spec.rb +99 -0
  52. data/spec/lib/polish_geeks/dev_tools/commands/bundler_audit_spec.rb +52 -0
  53. data/spec/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/file_parser_spec.rb +1 -1
  54. data/spec/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/string_refinements_spec.rb +1 -1
  55. data/spec/lib/{polishgeeks/dev-tools/commands/empty_method_spec.rb → polish_geeks/dev_tools/commands/empty_methods_spec.rb} +7 -54
  56. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/examples_comparator_spec.rb +8 -8
  57. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/expires_in_spec.rb +1 -1
  58. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/final_blank_line_spec.rb +2 -45
  59. data/spec/lib/polish_geeks/dev_tools/commands/gemfile_spec.rb +91 -0
  60. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/haml_lint_spec.rb +13 -21
  61. data/spec/lib/polish_geeks/dev_tools/commands/required_files_spec.rb +51 -0
  62. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_names_spec.rb +2 -2
  63. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_structure_spec.rb +19 -32
  64. data/spec/lib/polish_geeks/dev_tools/commands/rspec_spec.rb +106 -0
  65. data/spec/lib/polish_geeks/dev_tools/commands/rubocop_spec.rb +131 -0
  66. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rubycritic_spec.rb +5 -3
  67. data/spec/lib/polish_geeks/dev_tools/commands/simplecov_spec.rb +136 -0
  68. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/tasks_files_names_spec.rb +8 -8
  69. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yard_spec.rb +10 -10
  70. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yml_parser_spec.rb +2 -2
  71. data/spec/lib/polish_geeks/dev_tools/config_manager_spec.rb +124 -0
  72. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/config_spec.rb +3 -3
  73. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/errors_spec.rb +0 -0
  74. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/hash_spec.rb +8 -8
  75. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/logger_spec.rb +9 -9
  76. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/output_storer_spec.rb +1 -1
  77. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/runner_spec.rb +0 -0
  78. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/shell_spec.rb +1 -1
  79. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/base_spec.rb +0 -0
  80. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/rails_spec.rb +0 -0
  81. data/spec/lib/polish_geeks/dev_tools/validators/rubocop_spec.rb +29 -0
  82. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/simplecov_spec.rb +1 -1
  83. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/version_spec.rb +0 -0
  84. data/spec/lib/{polishgeeks-dev-tools_spec.rb → polish_geeks/dev_tools_spec.rb} +2 -2
  85. data/spec/spec_helper.rb +1 -1
  86. metadata +141 -99
  87. data/lib/polishgeeks/dev-tools/commands/readme.rb +0 -32
  88. data/spec/lib/polishgeeks/dev-tools/commands/base_spec.rb +0 -55
  89. data/spec/lib/polishgeeks/dev-tools/commands/brakeman_spec.rb +0 -96
  90. data/spec/lib/polishgeeks/dev-tools/commands/readme_spec.rb +0 -38
  91. data/spec/lib/polishgeeks/dev-tools/commands/rspec_spec.rb +0 -63
  92. data/spec/lib/polishgeeks/dev-tools/commands/rubocop_spec.rb +0 -127
  93. data/spec/lib/polishgeeks/dev-tools/commands/simplecov_spec.rb +0 -134
@@ -1,7 +1,6 @@
1
- $:.push File.expand_path("../lib", __FILE__)
1
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
2
2
 
3
- require 'rake'
4
- require 'polishgeeks/dev-tools/version'
3
+ require 'polish_geeks/dev_tools/version'
5
4
 
6
5
  Gem::Specification.new do |s|
7
6
  s.name = 'polishgeeks-dev-tools'
@@ -10,12 +9,13 @@ Gem::Specification.new do |s|
10
9
  s.authors = ['Maciej Mensfeld']
11
10
  s.email = ['maciej@mensfeld.pl']
12
11
  s.homepage = ''
13
- s.summary = %q(Set of tools used when developing Ruby based apps)
14
- s.description = %q(Set of tools used when developing Ruby based apps)
12
+ s.summary = 'Set of tools used when developing Ruby based apps'
13
+ s.description = 'Set of tools used when developing Ruby based apps'
15
14
 
16
15
  s.add_development_dependency 'bundler'
17
16
  s.add_development_dependency 'rake'
18
17
 
18
+ s.add_dependency 'bundler-audit'
19
19
  s.add_dependency 'simplecov'
20
20
  s.add_dependency 'rubycritic'
21
21
  s.add_dependency 'pry'
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency 'shoulda'
25
25
  s.add_dependency 'rspec'
26
26
  s.add_dependency 'rubocop'
27
+ s.add_dependency 'rubocop-rspec'
27
28
  s.add_dependency 'timecop'
28
29
  s.add_dependency 'brakeman'
29
30
  s.add_dependency 'haml-lint'
@@ -6,31 +6,24 @@ RSpec.describe PolishGeeks::DevTools::Commands::AllowedExtensions do
6
6
  describe '#execute' do
7
7
  let(:file_name) { 'file.rb' }
8
8
  let(:files) { [PolishGeeks::DevTools.app_root + '/config/' + file_name] }
9
- before do
10
- expect(Dir)
11
- .to receive(:[])
12
- .and_return(files)
13
- expect(described_class::ALLOWED_EXTENSIONS)
14
- .to receive(:any?)
15
- .and_return(allow_extension)
16
9
 
10
+ before do
11
+ expect(Dir).to receive(:[]) { files }
17
12
  subject.execute
18
13
  end
19
14
 
20
15
  context 'when we dont have invalid files' do
21
- let(:allow_extension) { true }
22
16
  it { expect(subject.output).to eq [] }
23
17
  end
24
18
 
25
19
  context 'when we have invalid files' do
26
- let(:allow_extension) { false }
20
+ let(:file_name) { 'file.py' }
27
21
  it { expect(subject.output).to eq [file_name] }
28
22
  end
29
23
  end
30
24
 
31
25
  describe '#label' do
32
26
  let(:expected) { 'Allowed Extensions' }
33
-
34
27
  it { expect(subject.label).to eq expected }
35
28
  end
36
29
 
@@ -41,17 +34,12 @@ RSpec.describe PolishGeeks::DevTools::Commands::AllowedExtensions do
41
34
  "\n\n#{output.join("\n")}\n"
42
35
  end
43
36
 
44
- before do
45
- subject.instance_variable_set('@output', output)
46
- end
47
-
37
+ before { subject.instance_variable_set('@output', output) }
48
38
  it { expect(subject.error_message).to eq expected }
49
39
  end
50
40
 
51
41
  describe do
52
- before do
53
- subject.instance_variable_set('@output', output)
54
- end
42
+ before { subject.instance_variable_set('@output', output) }
55
43
 
56
44
  context 'when output is empty' do
57
45
  let(:output) { '' }
@@ -0,0 +1,90 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe PolishGeeks::DevTools::Commands::Base do
4
+ subject { described_class.new }
5
+
6
+ describe '#execute' do
7
+ let(:error) { PolishGeeks::DevTools::Errors::NotImplementedError }
8
+ it { expect { subject.execute }. to raise_error(error) }
9
+ end
10
+
11
+ describe '#valid?' do
12
+ let(:error) { PolishGeeks::DevTools::Errors::NotImplementedError }
13
+ it { expect { subject.valid? }. to raise_error(error) }
14
+ end
15
+
16
+ describe '#error_message' do
17
+ let(:output) { rand.to_s }
18
+
19
+ before do
20
+ subject.instance_variable_set('@output', output)
21
+ end
22
+
23
+ it 'by default should equal raw output' do
24
+ expect(subject.error_message).to eq output
25
+ end
26
+ end
27
+
28
+ describe '#ensure_executable!' do
29
+ context 'when there are validators' do
30
+ let(:validator_class) { PolishGeeks::DevTools::Validators::Base }
31
+ let(:instance) { instance_double(PolishGeeks::DevTools::Validators::Base) }
32
+
33
+ before do
34
+ expect(described_class).to receive(:validators) { [validator_class] }
35
+ allow(validator_class).to receive(:new) { instance }
36
+ expect(instance).to receive(:validate!) { true }
37
+ end
38
+
39
+ it { expect { subject.ensure_executable! }.not_to raise_error }
40
+ end
41
+
42
+ context 'when we dont require any validators' do
43
+ before { expect(described_class).to receive(:validators) { [] } }
44
+ it { expect { subject.ensure_executable! }.not_to raise_error }
45
+ end
46
+ end
47
+
48
+ describe '#files_from_path' do
49
+ let(:app_root) { PolishGeeks::DevTools.app_root }
50
+
51
+ context 'path is a directory' do
52
+ let(:path) { rand.to_s }
53
+ let(:file_in_path) { "#{app_root}/#{rand}" }
54
+ let(:dir_in_path) { "#{app_root}/#{rand}" }
55
+ before do
56
+ expect(File)
57
+ .to receive(:file?)
58
+ .with("#{app_root}/#{path}")
59
+ .and_return(false)
60
+
61
+ expect(Dir)
62
+ .to receive(:glob)
63
+ .with("#{app_root}/#{path}")
64
+ .and_return([file_in_path, dir_in_path])
65
+
66
+ expect(File)
67
+ .to receive(:file?)
68
+ .with(file_in_path)
69
+ .and_return(true)
70
+
71
+ expect(File)
72
+ .to receive(:file?)
73
+ .with(dir_in_path)
74
+ .and_return(false)
75
+ end
76
+ it { expect(subject.send(:files_from_path, path)).to eq [file_in_path] }
77
+ end
78
+
79
+ context 'path is a file' do
80
+ let(:path) { rand.to_s }
81
+ before do
82
+ expect(File)
83
+ .to receive(:file?)
84
+ .with("#{app_root}/#{path}")
85
+ .and_return(true)
86
+ end
87
+ it { expect(subject.send(:files_from_path, path)).to eq ["#{app_root}/#{path}"] }
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,99 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe PolishGeeks::DevTools::Commands::Brakeman do
4
+ context 'class' do
5
+ subject { described_class }
6
+
7
+ describe '#validators' do
8
+ it 'works only when we have Rails framework' do
9
+ expect(subject.validators).to eq [PolishGeeks::DevTools::Validators::Rails]
10
+ end
11
+ end
12
+ end
13
+
14
+ context 'instance' do
15
+ subject { described_class.new }
16
+
17
+ describe '#execute' do
18
+ context 'when we run brakeman' do
19
+ let(:instance) { instance_double(PolishGeeks::DevTools::Shell) }
20
+
21
+ before do
22
+ allow(PolishGeeks::DevTools::Shell).to receive(:new) { instance }
23
+ expect(instance).to receive(:execute).with('bundle exec brakeman -q')
24
+ end
25
+
26
+ it 'executes the command' do
27
+ subject.execute
28
+ end
29
+ end
30
+ end
31
+
32
+ describe '#valid?' do
33
+ context 'when warnings are equal 0' do
34
+ before do
35
+ expect(subject)
36
+ .to receive(:warnings)
37
+ .and_return(0)
38
+ end
39
+
40
+ context 'and errors are equal 0' do
41
+ before do
42
+ expect(subject)
43
+ .to receive(:errors)
44
+ .and_return(0)
45
+ end
46
+
47
+ it 'returns true' do
48
+ expect(subject.valid?).to eq true
49
+ end
50
+ end
51
+
52
+ context 'and errors are not equal 0' do
53
+ before do
54
+ expect(subject)
55
+ .to receive(:errors)
56
+ .and_return(1)
57
+ end
58
+
59
+ it 'returns true' do
60
+ expect(subject.valid?).to eq false
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+ describe 'label' do
67
+ let(:models) { rand(1000) }
68
+ let(:controllers) { rand(1000) }
69
+ let(:templates) { rand(1000) }
70
+
71
+ before do
72
+ expect(subject).to receive(:models).and_return(models)
73
+ expect(subject).to receive(:controllers).and_return(controllers)
74
+ expect(subject).to receive(:templates).and_return(templates)
75
+ end
76
+
77
+ it 'uses details' do
78
+ label = "Brakeman (#{controllers} con, #{models} mod, #{templates} temp)"
79
+ expect(subject.label).to eq label
80
+ end
81
+ end
82
+
83
+ describe 'counter' do
84
+ described_class::REGEXPS.each do |name, _regexp|
85
+ describe "##{name}" do
86
+ let(:amount) { rand(1000) }
87
+
88
+ before do
89
+ subject.instance_variable_set(:@output, "#{name.to_s.capitalize} #{amount}")
90
+ end
91
+
92
+ it 'returns a proper value' do
93
+ expect(subject.send(name)).to eq amount
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe PolishGeeks::DevTools::Commands::BundlerAudit do
4
+ subject { described_class.new }
5
+
6
+ describe '#execute' do
7
+ let(:instance) { instance_double(PolishGeeks::DevTools::Shell) }
8
+
9
+ before do
10
+ allow(PolishGeeks::DevTools::Shell).to receive(:new) { instance }
11
+ expect(instance).to receive(:execute)
12
+ .with('bundle-audit update 2>&1 > /dev/null; bundle-audit check')
13
+ end
14
+
15
+ it { subject.execute }
16
+ end
17
+
18
+ describe '#valid?' do
19
+ context 'when there are vulnerabilities' do
20
+ before do
21
+ output = <<-EOS
22
+ Name: activesupport
23
+ Version: 3.2.10
24
+ Advisory: OSVDB-91451
25
+ Criticality: High
26
+ URL: http://www.osvdb.org/show/osvdb/91451
27
+ Title: XML Parsing Vulnerability affecting JRuby users
28
+ Solution: upgrade to ~> 3.1.12, >= 3.2.13
29
+
30
+ Unpatched versions found!
31
+ EOS
32
+ subject.instance_variable_set('@output', output)
33
+ end
34
+
35
+ it { expect(subject.valid?).to eq false }
36
+ end
37
+
38
+ context 'when there are no vulnerabilities' do
39
+ before { subject.instance_variable_set('@output', 'No vulnerabilities found') }
40
+
41
+ it { expect(subject.valid?).to eq true }
42
+ end
43
+ end
44
+
45
+ describe '.generator?' do
46
+ it { expect(described_class.generator?).to eq false }
47
+ end
48
+
49
+ describe '.validator?' do
50
+ it { expect(described_class.validator?).to eq true }
51
+ end
52
+ end
@@ -1,4 +1,4 @@
1
- RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod::FileParser do
1
+ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethods::FileParser do
2
2
  let(:file) { Tempfile.new('foo') }
3
3
  subject { described_class.new(file) }
4
4
 
@@ -1,4 +1,4 @@
1
- RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod::StringRefinements do
1
+ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethods::StringRefinements do
2
2
  using described_class
3
3
 
4
4
  describe '#defines_method?' do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'tempfile'
3
3
 
4
- RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod do
4
+ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethods do
5
5
  subject { described_class.new }
6
6
  describe '#execute' do
7
7
  let(:file) { [rand.to_s] }
@@ -21,7 +21,7 @@ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod do
21
21
  subject.execute
22
22
  end
23
23
 
24
- it 'should set appropriate variables' do
24
+ it 'sets appropriate variables' do
25
25
  expect(subject.output).to eq []
26
26
  expect(subject.counter).to eq(file.count)
27
27
  end
@@ -37,7 +37,7 @@ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod do
37
37
  subject.execute
38
38
  end
39
39
 
40
- it 'should set appropriate variables' do
40
+ it 'sets appropriate variables' do
41
41
  expect(subject.output.first).to eq "#{file.first} lines #{empty_methods}"
42
42
  expect(subject.counter).to eq(file.count)
43
43
  end
@@ -129,9 +129,9 @@ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod do
129
129
  end
130
130
 
131
131
  describe '#config_excludes' do
132
- context 'empty_method_ignored is set' do
132
+ context 'empty_methods_ignored is set' do
133
133
  let(:paths) { ["#{rand}.rb", "#{rand}.rb"] }
134
- let(:config) { double(empty_method_ignored: paths) }
134
+ let(:config) { double(empty_methods_ignored: paths) }
135
135
 
136
136
  before do
137
137
  expect(PolishGeeks::DevTools)
@@ -142,8 +142,8 @@ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod do
142
142
  it { expect(subject.send(:config_excludes)).to eq paths }
143
143
  end
144
144
 
145
- context 'empty_method_ignored is not set' do
146
- let(:config) { double(empty_method_ignored: nil) }
145
+ context 'empty_methods_ignored is not set' do
146
+ let(:config) { double(empty_methods_ignored: nil) }
147
147
 
148
148
  before do
149
149
  expect(PolishGeeks::DevTools)
@@ -155,53 +155,6 @@ RSpec.describe PolishGeeks::DevTools::Commands::EmptyMethod do
155
155
  end
156
156
  end
157
157
 
158
- describe '#files_from_path' do
159
- let(:app_root) { PolishGeeks::DevTools.app_root }
160
-
161
- context 'path is a directory' do
162
- let(:path) { rand.to_s }
163
- let(:file_in_path) { "#{app_root}/#{rand}" }
164
- let(:dir_in_path) { "#{app_root}/#{rand}" }
165
-
166
- before do
167
- expect(File)
168
- .to receive(:file?)
169
- .with("#{app_root}/#{path}")
170
- .and_return(false)
171
-
172
- expect(Dir)
173
- .to receive(:glob)
174
- .with("#{app_root}/#{path}")
175
- .and_return([file_in_path, dir_in_path])
176
-
177
- expect(File)
178
- .to receive(:file?)
179
- .with(file_in_path)
180
- .and_return(true)
181
-
182
- expect(File)
183
- .to receive(:file?)
184
- .with(dir_in_path)
185
- .and_return(false)
186
- end
187
-
188
- it { expect(subject.send(:files_from_path, path)).to eq [file_in_path] }
189
- end
190
-
191
- context 'path is a file' do
192
- let(:path) { rand.to_s }
193
-
194
- before do
195
- expect(File)
196
- .to receive(:file?)
197
- .with("#{app_root}/#{path}")
198
- .and_return(true)
199
- end
200
-
201
- it { expect(subject.send(:files_from_path, path)).to eq ["#{app_root}/#{path}"] }
202
- end
203
- end
204
-
205
158
  describe '#sanitize' do
206
159
  let(:file) { rand.to_s }
207
160
  let(:app_root) { PolishGeeks::DevTools.app_root }