rake_check 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rake_check/brakeman_checker.rb +2 -2
- data/lib/rake_check/version.rb +1 -1
- data/spec/lib/rake_check/brakeman_checker_spec.rb +1 -1
- data/spec/lib/rake_check/cane_checker_spec.rb +6 -6
- data/spec/lib/rake_check/cucumber_checker_spec.rb +3 -3
- data/spec/lib/rake_check/rbp_checker_spec.rb +3 -3
- data/spec/lib/rake_check/reek_checker_spec.rb +3 -3
- data/spec/lib/rake_check/rspec_checker_spec.rb +7 -7
- data/spec/lib/rake_check/yard_checker_spec.rb +5 -5
- metadata +17 -17
@@ -13,9 +13,9 @@ class BrakemanChecker
|
|
13
13
|
# @author dmasur
|
14
14
|
def result
|
15
15
|
begin
|
16
|
-
@tracker = Brakeman.run(
|
16
|
+
@tracker = Brakeman.run('.')
|
17
17
|
rescue SystemExit
|
18
|
-
"
|
18
|
+
return { type: :brakeman, check_output: "", status: "Rails App not found" }
|
19
19
|
end
|
20
20
|
{ type: :brakeman, check_output: output, status: status }
|
21
21
|
end
|
data/lib/rake_check/version.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/brak
|
|
3
3
|
describe BrakemanChecker do
|
4
4
|
let(:tracker) { stub("Tracker", checks: stub("Checks", warnings: [])) }
|
5
5
|
it "gives N/A on no Rails Apps" do
|
6
|
-
subject.result.should == { type: :brakeman, check_output: '', status: '
|
6
|
+
subject.result.should == { type: :brakeman, check_output: '', status: 'Rails App not found' }
|
7
7
|
end
|
8
8
|
it "gives OK with no Errors" do
|
9
9
|
Brakeman.should_receive(:run).and_return tracker
|
@@ -2,18 +2,18 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/cane
|
|
2
2
|
|
3
3
|
describe CaneChecker do
|
4
4
|
it "gives N/A on Error" do
|
5
|
-
subject.stub(:`
|
5
|
+
subject.stub(:`).and_return('Error')
|
6
6
|
subject.result.should == { type: :cane, check_output: 'Error', status: 'N/A' }
|
7
7
|
end
|
8
8
|
it "gives OK with no Errors" do
|
9
|
-
subject.stub(:`
|
9
|
+
subject.stub(:`).and_return('')
|
10
10
|
subject.result.should == { type: :cane,
|
11
11
|
check_output: '',
|
12
12
|
status: "\e[32mOK\e[0m" }
|
13
13
|
end
|
14
14
|
it "adds Class and Line violations" do
|
15
15
|
shell_output = "Lines violated style requirements (10):\nClasses are not documented (1):"
|
16
|
-
subject.stub(:`
|
16
|
+
subject.stub(:`).and_return(shell_output)
|
17
17
|
subject.result.should == { type: :cane,
|
18
18
|
check_output: shell_output,
|
19
19
|
status: "\e[31m11\e[0m Style Violations" }
|
@@ -21,21 +21,21 @@ describe CaneChecker do
|
|
21
21
|
it "dont count other infos" do
|
22
22
|
shell_output = "Lines violated style requirements (1):
|
23
23
|
app/models/foo.rb:14 Line is >100 characters (115)"
|
24
|
-
subject.stub(:`
|
24
|
+
subject.stub(:`).and_return(shell_output)
|
25
25
|
subject.result.should == { type: :cane,
|
26
26
|
check_output: shell_output,
|
27
27
|
status: "\e[33m1\e[0m Style Violations" }
|
28
28
|
end
|
29
29
|
it "is yellow under 10 Violations" do
|
30
30
|
shell_output = "Lines violated style requirements (10):"
|
31
|
-
subject.stub(:`
|
31
|
+
subject.stub(:`).and_return(shell_output)
|
32
32
|
subject.result.should == { type: :cane,
|
33
33
|
check_output: shell_output,
|
34
34
|
status: "\e[31m10\e[0m Style Violations" }
|
35
35
|
end
|
36
36
|
it "is red under 10 Violations" do
|
37
37
|
shell_output = "Lines violated style requirements (9):"
|
38
|
-
subject.stub(:`
|
38
|
+
subject.stub(:`).and_return(shell_output)
|
39
39
|
subject.result.should == { type: :cane,
|
40
40
|
check_output: shell_output,
|
41
41
|
status: "\e[33m9\e[0m Style Violations" }
|
@@ -2,17 +2,17 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/cucu
|
|
2
2
|
|
3
3
|
describe CucumberChecker do
|
4
4
|
it "gives N/A on Error" do
|
5
|
-
subject.stub(:`
|
5
|
+
subject.stub(:`).and_return('Error')
|
6
6
|
subject.result.should == { type: :cucumber, check_output: '', status: 'N/A' }
|
7
7
|
end
|
8
8
|
it "gives OK with no Errors" do
|
9
|
-
subject.stub(:`
|
9
|
+
subject.stub(:`).and_return('8 scenarios (8 passed)')
|
10
10
|
subject.result.should == { type: :cucumber,
|
11
11
|
check_output: '',
|
12
12
|
status: "\e[32mOK\e[0m" }
|
13
13
|
end
|
14
14
|
it "is red on Error" do
|
15
|
-
subject.stub(:`
|
15
|
+
subject.stub(:`).and_return('8 scenarios (1 failed, 7 passed)')
|
16
16
|
subject.result.should == { type: :cucumber,
|
17
17
|
check_output: '8 scenarios (1 failed, 7 passed)',
|
18
18
|
status: "\e[31m1 failed scenarios\e[0m" }
|
@@ -2,15 +2,15 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/rbp_
|
|
2
2
|
|
3
3
|
describe RbpChecker do
|
4
4
|
it "gives N/A on Error" do
|
5
|
-
subject.stub(:`
|
5
|
+
subject.stub(:`).and_return('Error')
|
6
6
|
subject.result.should == { type: :rbp, check_output: 'Error', status: 'N/A' }
|
7
7
|
end
|
8
8
|
it "gives OK with no Errors" do
|
9
|
-
subject.stub(:`
|
9
|
+
subject.stub(:`).and_return('No warning found. Cool!')
|
10
10
|
subject.result.should == { type: :rbp, check_output: '', status: "\e[32mOK\e[0m" }
|
11
11
|
end
|
12
12
|
it "gives warning message with Errors" do
|
13
|
-
subject.stub(:`
|
13
|
+
subject.stub(:`).and_return('Found 1 warnings.')
|
14
14
|
subject.result.should == { type: :rbp,
|
15
15
|
check_output: 'Found 1 warnings.',
|
16
16
|
status: "\e[31mFound 1 warnings\e[0m" }
|
@@ -2,17 +2,17 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/reek
|
|
2
2
|
describe ReekChecker do
|
3
3
|
it "gives N/A on Error" do
|
4
4
|
require 'ruby_parser'
|
5
|
-
subject.stub(:`
|
5
|
+
subject.stub(:`).and_return('Error')
|
6
6
|
subject.result.should == { type: :reek, check_output: 'Error', status: "\e[31mN/A\e[0m" }
|
7
7
|
end
|
8
8
|
it "gives OK on no Error" do
|
9
|
-
subject.stub(:`
|
9
|
+
subject.stub(:`).and_return('warning: already initialized constant ENC_UTF8')
|
10
10
|
subject.result.should == { type: :reek, check_output: '', status: "\e[32mOK\e[0m" }
|
11
11
|
end
|
12
12
|
it "gives Error with on Codesmells" do
|
13
13
|
shell_output = File.read(File.expand_path(File.dirname(__FILE__) +
|
14
14
|
'/../../files/reek_output.yaml'))
|
15
|
-
subject.stub(:`
|
15
|
+
subject.stub(:`).and_return(shell_output)
|
16
16
|
check_output = "DuplicateMethodCall: ReekChecker#status@19, 20, 21, 22, 23\n"
|
17
17
|
check_output += "TooManyStatements: ReekChecker#status@17"
|
18
18
|
subject.result.should == { type: :reek,
|
@@ -2,20 +2,20 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/rspe
|
|
2
2
|
|
3
3
|
describe RspecChecker do
|
4
4
|
it "gives N/A on Error" do
|
5
|
-
subject.stub(:`
|
5
|
+
subject.stub(:`).and_return('Error')
|
6
6
|
subject.result.should == { type: "spec", check_output: 'Error', status: 'N/A' }
|
7
7
|
end
|
8
8
|
it "gives OK with no Errors" do
|
9
|
-
subject.stub(:`
|
9
|
+
subject.stub(:`).and_return('6 examples, 0 failures')
|
10
10
|
subject.result.should == { type: "spec", check_output: '', status: "\e[32mOK\e[0m" }
|
11
11
|
end
|
12
12
|
it "gives warning message with Errors" do
|
13
|
-
subject.stub(:`
|
13
|
+
subject.stub(:`).and_return('6 examples, 3 failures')
|
14
14
|
subject.result.should == { type: "spec", check_output: '6 examples, 3 failures',
|
15
15
|
status: "\e[31m3 failures\e[0m" }
|
16
16
|
end
|
17
17
|
it "gives warning message with one Error" do
|
18
|
-
subject.stub(:`
|
18
|
+
subject.stub(:`).and_return('6 examples, 1 failure')
|
19
19
|
subject.result.should == { type: "spec", check_output: '6 examples, 1 failure',
|
20
20
|
status: "\e[31m1 failure\e[0m" }
|
21
21
|
end
|
@@ -23,21 +23,21 @@ describe RspecChecker do
|
|
23
23
|
it "is green over 90%" do
|
24
24
|
check_output = "6 examples, 0 failures
|
25
25
|
Coverage report generated for RSpec to /foo/bar/coverage. 38 / 38 LOC (93.90%) covered."
|
26
|
-
subject.stub(:`
|
26
|
+
subject.stub(:`).and_return(check_output)
|
27
27
|
subject.result.should == { type: "spec", check_output: '',
|
28
28
|
status: "\e[32mOK\e[0m with \e[32m93.9%\e[0m Code Coverage" }
|
29
29
|
end
|
30
30
|
it "is green over 70%" do
|
31
31
|
check_output = "6 examples, 0 failures
|
32
32
|
Coverage report generated for RSpec to /foo/bar/coverage. 38 / 38 LOC (73.90%) covered."
|
33
|
-
subject.stub(:`
|
33
|
+
subject.stub(:`).and_return(check_output)
|
34
34
|
subject.result.should == { type: "spec", check_output: '',
|
35
35
|
status: "\e[32mOK\e[0m with \e[33m73.9%\e[0m Code Coverage" }
|
36
36
|
end
|
37
37
|
it "is green over 10%" do
|
38
38
|
check_output = "6 examples, 0 failures
|
39
39
|
Coverage report generated for RSpec to /foo/bar/coverage. 38 / 38 LOC (13.90%) covered."
|
40
|
-
subject.stub(:`
|
40
|
+
subject.stub(:`).and_return(check_output)
|
41
41
|
subject.result.should == { type: "spec", check_output: '',
|
42
42
|
status: "\e[32mOK\e[0m with \e[31m13.9%\e[0m Code Coverage" }
|
43
43
|
end
|
@@ -2,30 +2,30 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/yard
|
|
2
2
|
|
3
3
|
describe YardChecker do
|
4
4
|
it "gives N/A on Error" do
|
5
|
-
subject.stub(:`
|
5
|
+
subject.stub(:`).and_return('Error')
|
6
6
|
subject.result.should == { type: :yard, check_output: 'Error', status: 'N/A' }
|
7
7
|
end
|
8
8
|
it "gives OK with no Errors" do
|
9
|
-
subject.stub(:`
|
9
|
+
subject.stub(:`).and_return('100.00% documented')
|
10
10
|
subject.result.should == { type: :yard,
|
11
11
|
check_output: '',
|
12
12
|
status: "\e[32m100.0%\e[0m documented" }
|
13
13
|
end
|
14
14
|
describe "Code Coverage" do
|
15
15
|
it "is green over 90%" do
|
16
|
-
subject.stub(:`
|
16
|
+
subject.stub(:`).and_return("93.00% documented")
|
17
17
|
subject.result.should == { type: :yard,
|
18
18
|
check_output: '',
|
19
19
|
status: "\e[32m93.0%\e[0m documented" }
|
20
20
|
end
|
21
21
|
it "is green over 70%" do
|
22
|
-
subject.stub(:`
|
22
|
+
subject.stub(:`).and_return("73.00% documented")
|
23
23
|
subject.result.should == { type: :yard,
|
24
24
|
check_output: '',
|
25
25
|
status: "\e[33m73.0%\e[0m documented" }
|
26
26
|
end
|
27
27
|
it "is green over 10%" do
|
28
|
-
subject.stub(:`
|
28
|
+
subject.stub(:`).and_return("13.00% documented")
|
29
29
|
subject.result.should == { type: :yard,
|
30
30
|
check_output: '',
|
31
31
|
status: "\e[31m13.0%\e[0m documented" }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-06-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70186652687100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70186652687100
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: colored
|
27
|
-
requirement: &
|
27
|
+
requirement: &70186652685280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70186652685280
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70186644552300 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70186644552300
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: reek
|
49
|
-
requirement: &
|
49
|
+
requirement: &70186644551160 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70186644551160
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: cane
|
60
|
-
requirement: &
|
60
|
+
requirement: &70186644550220 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70186644550220
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: cucumber
|
71
|
-
requirement: &
|
71
|
+
requirement: &70186644549120 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70186644549120
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: brakeman
|
82
|
-
requirement: &
|
82
|
+
requirement: &70186644548340 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70186644548340
|
91
91
|
description: Checking the Project for Code Smells and bad documentation
|
92
92
|
email:
|
93
93
|
- dominik.masur@googlemail.com
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
segments:
|
145
145
|
- 0
|
146
|
-
hash:
|
146
|
+
hash: 3375724839407034492
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
segments:
|
154
154
|
- 0
|
155
|
-
hash:
|
155
|
+
hash: 3375724839407034492
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
158
|
rubygems_version: 1.8.10
|