reek 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/README.md +27 -2
- data/features/command_line_interface/options.feature +5 -2
- data/features/command_line_interface/smells_count.feature +43 -45
- data/features/command_line_interface/stdin.feature +9 -15
- data/features/configuration_files/masking_smells.feature +9 -17
- data/features/rake_task/rake_task.feature +4 -4
- data/features/reports/reports.feature +80 -21
- data/features/samples.feature +8 -18
- data/features/step_definitions/reek_steps.rb +4 -0
- data/lib/reek/cli/application.rb +3 -6
- data/lib/reek/cli/command_line.rb +16 -6
- data/lib/reek/cli/reek_command.rb +4 -12
- data/lib/reek/cli/report.rb +61 -19
- data/lib/reek/config_file_exception.rb +5 -0
- data/lib/reek/smells/control_parameter.rb +45 -14
- data/lib/reek/smells/data_clump.rb +15 -39
- data/lib/reek/smells/duplicate_method_call.rb +76 -26
- data/lib/reek/source/config_file.rb +30 -19
- data/lib/reek/source/sexp_extensions.rb +139 -0
- data/lib/reek/source/sexp_node.rb +64 -0
- data/lib/reek/source/source_code.rb +1 -1
- data/lib/reek/source/tree_dresser.rb +30 -175
- data/lib/reek/spec/should_reek.rb +2 -5
- data/lib/reek/version.rb +1 -1
- data/reek.gemspec +1 -1
- data/spec/matchers/smell_of_matcher.rb +12 -15
- data/spec/reek/cli/report_spec.rb +10 -6
- data/spec/reek/core/code_parser_spec.rb +0 -6
- data/spec/reek/smells/control_parameter_spec.rb +195 -8
- data/spec/reek/smells/data_clump_spec.rb +28 -3
- data/spec/reek/smells/uncommunicative_method_name_spec.rb +7 -7
- data/spec/reek/source/sexp_extensions_spec.rb +290 -0
- data/spec/reek/source/sexp_node_spec.rb +28 -0
- data/spec/reek/source/source_code_spec.rb +59 -19
- data/spec/reek/source/tree_dresser_spec.rb +7 -314
- data/spec/reek/spec/should_reek_spec.rb +51 -64
- data/spec/samples/all_but_one_masked/dirty.rb +2 -2
- data/spec/samples/corrupt_config_file/dirty.rb +1 -0
- data/spec/samples/masked/dirty.rb +1 -1
- data/spec/samples/masked_by_dotfile/dirty.rb +2 -2
- data/spec/samples/no_config_file/dirty.rb +8 -0
- data/spec/samples/not_quite_masked/dirty.rb +0 -3
- data/spec/samples/three_smelly_files/dirty_one.rb +3 -0
- data/spec/samples/three_smelly_files/dirty_three.rb +5 -0
- data/spec/samples/three_smelly_files/dirty_two.rb +4 -0
- data/spec/spec_helper.rb +5 -0
- metadata +145 -137
- data/spec/reek/cli/reek_command_spec.rb +0 -46
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'reek/cli/reek_command'
|
3
|
-
require 'reek/cli/report'
|
4
|
-
require 'reek/examiner'
|
5
|
-
|
6
|
-
include Reek
|
7
|
-
include Reek::Cli
|
8
|
-
|
9
|
-
describe ReekCommand do
|
10
|
-
before :each do
|
11
|
-
@view = double('view').as_null_object
|
12
|
-
end
|
13
|
-
|
14
|
-
context 'with smells' do
|
15
|
-
before :each do
|
16
|
-
examiner = Examiner.new('def x(); end')
|
17
|
-
@cmd = ReekCommand.new(QuietReport.new, ['def x(); end'])
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'displays the correct text on the view' do
|
21
|
-
@view.should_receive(:output).with(/UncommunicativeMethodName/)
|
22
|
-
@cmd.execute(@view)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'tells the view it succeeded' do
|
26
|
-
@view.should_receive(:report_smells)
|
27
|
-
@cmd.execute(@view)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'with no smells' do
|
32
|
-
before :each do
|
33
|
-
@cmd = ReekCommand.new(QuietReport.new, ['def clean(); end'])
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'displays nothing on the view' do
|
37
|
-
@view.should_receive(:output).with('')
|
38
|
-
@cmd.execute(@view)
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'tells the view it succeeded' do
|
42
|
-
@view.should_receive(:report_success)
|
43
|
-
@cmd.execute(@view)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|