polishgeeks-dev-tools 1.3.2 → 1.4.0

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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +2 -3
  4. data/CHANGELOG.md +13 -0
  5. data/Gemfile +2 -0
  6. data/Gemfile.lock +53 -55
  7. data/config/rubocop_rspec.yml +6 -0
  8. data/lib/polish_geeks/dev_tools/commands/base.rb +4 -4
  9. data/lib/polish_geeks/dev_tools/commands/brakeman.rb +1 -1
  10. data/lib/polish_geeks/dev_tools/commands/empty_methods/file_parser.rb +1 -1
  11. data/lib/polish_geeks/dev_tools/commands/final_blank_line.rb +3 -1
  12. data/lib/polish_geeks/dev_tools/commands/rubocop.rb +1 -1
  13. data/lib/polish_geeks/dev_tools/version.rb +1 -1
  14. data/lib/polishgeeks-dev-tools.rb +0 -1
  15. data/polishgeeks_dev_tools.gemspec +0 -1
  16. data/spec/lib/polish_geeks/dev_tools/commands/allowed_extensions_spec.rb +10 -10
  17. data/spec/lib/polish_geeks/dev_tools/commands/base_spec.rb +9 -9
  18. data/spec/lib/polish_geeks/dev_tools/commands/brakeman_spec.rb +15 -21
  19. data/spec/lib/polish_geeks/dev_tools/commands/bundler_audit_spec.rb +6 -6
  20. data/spec/lib/polish_geeks/dev_tools/commands/empty_methods/file_parser_spec.rb +18 -18
  21. data/spec/lib/polish_geeks/dev_tools/commands/empty_methods_spec.rb +29 -35
  22. data/spec/lib/polish_geeks/dev_tools/commands/examples_comparator_spec.rb +22 -24
  23. data/spec/lib/polish_geeks/dev_tools/commands/expires_in_spec.rb +9 -11
  24. data/spec/lib/polish_geeks/dev_tools/commands/final_blank_line_spec.rb +31 -35
  25. data/spec/lib/polish_geeks/dev_tools/commands/gemfile_spec.rb +17 -17
  26. data/spec/lib/polish_geeks/dev_tools/commands/haml_lint_spec.rb +7 -15
  27. data/spec/lib/polish_geeks/dev_tools/commands/required_files_spec.rb +8 -8
  28. data/spec/lib/polish_geeks/dev_tools/commands/rspec_files_names_spec.rb +19 -15
  29. data/spec/lib/polish_geeks/dev_tools/commands/rspec_files_structure_spec.rb +40 -44
  30. data/spec/lib/polish_geeks/dev_tools/commands/rspec_spec.rb +22 -22
  31. data/spec/lib/polish_geeks/dev_tools/commands/rubocop_spec.rb +21 -29
  32. data/spec/lib/polish_geeks/dev_tools/commands/rubycritic_spec.rb +2 -4
  33. data/spec/lib/polish_geeks/dev_tools/commands/simplecov_spec.rb +18 -28
  34. data/spec/lib/polish_geeks/dev_tools/commands/tasks_files_names_spec.rb +24 -25
  35. data/spec/lib/polish_geeks/dev_tools/commands/yard_spec.rb +10 -24
  36. data/spec/lib/polish_geeks/dev_tools/commands/yml_parser_spec.rb +15 -19
  37. data/spec/lib/polish_geeks/dev_tools/config_manager_spec.rb +33 -33
  38. data/spec/lib/polish_geeks/dev_tools/config_spec.rb +10 -10
  39. data/spec/lib/polish_geeks/dev_tools/errors_spec.rb +4 -4
  40. data/spec/lib/polish_geeks/dev_tools/hash_spec.rb +5 -5
  41. data/spec/lib/polish_geeks/dev_tools/logger_spec.rb +13 -13
  42. data/spec/lib/polish_geeks/dev_tools/output_storer_spec.rb +2 -2
  43. data/spec/lib/polish_geeks/dev_tools/runner_spec.rb +2 -2
  44. data/spec/lib/polish_geeks/dev_tools/shell_spec.rb +2 -2
  45. data/spec/lib/polish_geeks/dev_tools/validators/base_spec.rb +7 -7
  46. data/spec/lib/polish_geeks/dev_tools/validators/rails_spec.rb +3 -3
  47. data/spec/lib/polish_geeks/dev_tools/validators/rubocop_spec.rb +3 -3
  48. data/spec/lib/polish_geeks/dev_tools/validators/simplecov_spec.rb +12 -11
  49. data/spec/lib/polish_geeks/dev_tools/version_spec.rb +1 -3
  50. data/spec/lib/polish_geeks/dev_tools_spec.rb +7 -13
  51. metadata +3 -18
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools::OutputStorer do
4
- subject { described_class.new }
4
+ subject(:output_storer) { described_class.new }
5
5
 
6
6
  describe '#initialize' do
7
7
  context 'when we execute the command' do
@@ -13,7 +13,7 @@ RSpec.describe PolishGeeks::DevTools::OutputStorer do
13
13
  end
14
14
 
15
15
  it 'stores an output' do
16
- expect(subject.send(:initialize)).to eq result
16
+ expect(output_storer.send(:initialize)).to eq result
17
17
  end
18
18
  end
19
19
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools::Runner do
4
- subject { described_class.new }
4
+ subject(:runner) { described_class.new }
5
5
 
6
6
  describe '#execute' do
7
7
  let(:logger) { double }
@@ -55,6 +55,6 @@ RSpec.describe PolishGeeks::DevTools::Runner do
55
55
  end
56
56
  end
57
57
 
58
- it { subject.execute(logger) }
58
+ it { runner.execute(logger) }
59
59
  end
60
60
  end
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools::Shell do
4
- subject { described_class.new }
4
+ subject(:shell) { described_class.new }
5
5
 
6
6
  describe '#execute' do
7
7
  context 'when we run a command' do
8
8
  it 'executes the command' do
9
- expect(subject.execute('ls')).to include('Gemfile')
9
+ expect(shell.execute('ls')).to include('Gemfile')
10
10
  end
11
11
  end
12
12
  end
@@ -1,31 +1,31 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools::Validators::Base do
4
+ subject(:base) { described_class.new(output) }
4
5
  let(:output) { :output }
5
- subject { described_class.new(output) }
6
6
 
7
7
  describe '#new' do
8
- it { expect(subject.instance_variable_get(:@stored_output)).to eq output }
8
+ it { expect(base.instance_variable_get(:@stored_output)).to eq output }
9
9
  end
10
10
 
11
11
  describe '#valid?' do
12
12
  it do
13
- expect { subject.valid? }.to raise_error(PolishGeeks::DevTools::Errors::NotImplementedError)
13
+ expect { base.valid? }.to raise_error(PolishGeeks::DevTools::Errors::NotImplementedError)
14
14
  end
15
15
  end
16
16
 
17
17
  describe '#validate!' do
18
18
  context 'valid? true' do
19
- before { expect(subject).to receive(:valid?) { true } }
19
+ before { expect(base).to receive(:valid?) { true } }
20
20
 
21
- it { expect { subject.validate! }.not_to raise_error }
21
+ it { expect { base.validate! }.not_to raise_error }
22
22
  end
23
23
 
24
24
  context 'valid? false' do
25
- before { expect(subject).to receive(:valid?) { false } }
25
+ before { expect(base).to receive(:valid?) { false } }
26
26
 
27
27
  it do
28
- expect { subject.validate! }.to raise_error(
28
+ expect { base.validate! }.to raise_error(
29
29
  PolishGeeks::DevTools::Errors::PreCommandValidationError
30
30
  )
31
31
  end
@@ -1,20 +1,20 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools::Validators::Rails do
4
- subject { described_class.new(double) }
4
+ subject(:rails) { described_class.new(double) }
5
5
 
6
6
  describe '#valid?' do
7
7
  context 'false' do
8
8
  context 'when Rails not defined' do
9
9
  before { allow(Object).to receive(:const_defined?) { false } }
10
- it { expect(subject.valid?).to be false }
10
+ it { expect(rails.valid?).to be false }
11
11
  end
12
12
  end
13
13
 
14
14
  context 'true' do
15
15
  context 'when Rails defined' do
16
16
  before { allow(Object).to receive(:const_defined?) { true } }
17
- it { expect(subject.valid?).to be true }
17
+ it { expect(rails.valid?).to be true }
18
18
  end
19
19
  end
20
20
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools::Validators::Rubocop do
4
- subject { described_class.new(double) }
4
+ subject(:rubocop) { described_class.new(double) }
5
5
 
6
6
  describe '#valid?' do
7
7
  context 'false' do
@@ -11,7 +11,7 @@ RSpec.describe PolishGeeks::DevTools::Validators::Rubocop do
11
11
  instance_double(PolishGeeks::DevTools::Config, rubocop: false)
12
12
  )
13
13
  end
14
- it { expect(subject.valid?).to be false }
14
+ it { expect(rubocop.valid?).to be false }
15
15
  end
16
16
  end
17
17
 
@@ -22,7 +22,7 @@ RSpec.describe PolishGeeks::DevTools::Validators::Rubocop do
22
22
  instance_double(PolishGeeks::DevTools::Config, rubocop: true)
23
23
  )
24
24
  end
25
- it { expect(subject.valid?).to be true }
25
+ it { expect(rubocop.valid?).to be true }
26
26
  end
27
27
  end
28
28
  end
@@ -1,15 +1,15 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools::Validators::Simplecov do
4
+ subject(:simplecov) { described_class.new(output) }
4
5
  let(:output) do
5
6
  OpenStruct.new(
6
7
  rspec: '370 / 669 LOC (95.00%) covered'
7
8
  )
8
9
  end
9
- subject { described_class.new(output) }
10
10
 
11
11
  describe '#valid?' do
12
- subject do
12
+ subject(:simplecov) do
13
13
  described_class.new(
14
14
  OpenStruct.new(
15
15
  rspec: 'output'
@@ -19,26 +19,27 @@ RSpec.describe PolishGeeks::DevTools::Validators::Simplecov do
19
19
 
20
20
  context 'false' do
21
21
  context 'when SimpleCov not defined' do
22
- before { allow(Object).to receive(:const_defined?) { false } }
23
- it do
24
- expect(subject).to receive(:output)
25
- expect(subject.valid?).to be false
22
+ before do
23
+ allow(Object).to receive(:const_defined?) { false }
24
+ expect(simplecov).to receive(:output)
26
25
  end
26
+ it { expect(simplecov.valid?).to be false }
27
27
  end
28
28
  end
29
29
 
30
30
  context 'true' do
31
31
  context 'when SimpleCov defined' do
32
- before { allow(Object).to receive(:const_defined?) { true } }
33
- it do
34
- expect(subject).not_to receive(:output)
35
- expect(subject.valid?).to be true
32
+ before do
33
+ allow(Object).to receive(:const_defined?) { true }
34
+ expect(simplecov).not_to receive(:output)
36
35
  end
36
+
37
+ it { expect(simplecov.valid?).to be true }
37
38
  end
38
39
  end
39
40
  end
40
41
 
41
42
  describe '#output' do
42
- it { expect(subject.output).to eq('(95.00%) covered') }
43
+ it { expect(simplecov.output).to eq('(95.00%) covered') }
43
44
  end
44
45
  end
@@ -1,7 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools do
4
- subject { described_class }
5
-
6
- it { should be_const_defined(:VERSION) }
4
+ it { is_expected.to be_const_defined(:VERSION) }
7
5
  end
@@ -1,35 +1,29 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe PolishGeeks::DevTools do
4
- subject { described_class }
4
+ subject(:dev_tools) { described_class }
5
5
 
6
6
  describe '.gem_root' do
7
7
  context 'when we want to get gem root path' do
8
8
  let(:path) { Dir.pwd }
9
- it do
10
- expect(subject.gem_root).to eq path
11
- end
9
+ it { expect(dev_tools.gem_root).to eq path }
12
10
  end
13
11
  end
14
12
 
15
13
  describe '.app_root' do
16
14
  context 'when we want to get app root path' do
17
- before do
18
- expect(ENV).to receive(:[]).with('BUNDLE_GEMFILE').and_return('/')
19
- end
20
-
21
- it { expect(subject.app_root).to eq '/' }
15
+ before { expect(ENV).to receive(:[]).with('BUNDLE_GEMFILE').and_return('/') }
16
+ it { expect(dev_tools.app_root).to eq '/' }
22
17
  end
23
18
  end
24
19
 
25
20
  describe '.setup' do
26
21
  let(:config_block) { -> {} }
27
22
 
28
- it 'passes it to Config setup method' do
29
- expect(described_class::Config)
30
- .to receive(:setup)
23
+ before { expect(described_class::Config).to receive(:setup) }
31
24
 
32
- subject.setup(&config_block)
25
+ it 'passes it to Config setup method' do
26
+ dev_tools.setup(&config_block)
33
27
  end
34
28
  end
35
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polishgeeks-dev-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-27 00:00:00.000000000 Z
11
+ date: 2016-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: pry
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: yard
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -336,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
336
322
  version: '0'
337
323
  requirements: []
338
324
  rubyforge_project:
339
- rubygems_version: 2.5.1
325
+ rubygems_version: 2.5.2
340
326
  signing_key:
341
327
  specification_version: 4
342
328
  summary: Set of tools used when developing Ruby based apps
@@ -378,4 +364,3 @@ test_files:
378
364
  - spec/lib/polish_geeks/dev_tools/version_spec.rb
379
365
  - spec/lib/polish_geeks/dev_tools_spec.rb
380
366
  - spec/spec_helper.rb
381
- has_rdoc: