roodi 1.3.5 → 1.3.6
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.
data/History.txt
CHANGED
data/lib/roodi.rb
CHANGED
@@ -7,7 +7,7 @@ module Roodi
|
|
7
7
|
# When the body of a rescue block is empty, exceptions can get caught and swallowed without
|
8
8
|
# any feedback to the user.
|
9
9
|
class EmptyRescueBodyCheck < Check
|
10
|
-
STATEMENT_NODES = [:fcall, :return, :attrasgn, :vcall]
|
10
|
+
STATEMENT_NODES = [:fcall, :return, :attrasgn, :vcall, :nil]
|
11
11
|
|
12
12
|
def interesting_nodes
|
13
13
|
[:resbody]
|
@@ -90,6 +90,15 @@ describe Roodi::Checks::EmptyRescueBodyCheck do
|
|
90
90
|
errors[0].to_s.should eql("dummy-file.rb:3 - Rescue block should not be empty.")
|
91
91
|
end
|
92
92
|
|
93
|
+
it "should accept a rescue block with an explicit nil" do
|
94
|
+
content = <<-END
|
95
|
+
call_method rescue nil
|
96
|
+
END
|
97
|
+
@roodi.check_content(content)
|
98
|
+
errors = @roodi.errors
|
99
|
+
errors.should be_empty
|
100
|
+
end
|
101
|
+
|
93
102
|
it "should reject an empty rescue block with a parameter" do
|
94
103
|
content = <<-END
|
95
104
|
begin
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roodi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marty Andrews
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04
|
12
|
+
date: 2009-05-04 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|