kevinrutherford-reek 0.3.1.5 → 0.3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/reek/spec.rb +16 -0
- data/lib/reek.rb +1 -1
- data/spec/spec_helper.rb +0 -4
- metadata +1 -1
data/lib/reek/spec.rb
CHANGED
@@ -5,6 +5,10 @@ module Reek
|
|
5
5
|
#
|
6
6
|
# Provides matchers for Rspec, making it easy to check code quality.
|
7
7
|
#
|
8
|
+
# If you require this module somewhere within your spec (or in your spec_helper),
|
9
|
+
# Reek will arrange to update Spec::Runner's config so that it knows about the
|
10
|
+
# matchers defined here.
|
11
|
+
#
|
8
12
|
# === Examples
|
9
13
|
#
|
10
14
|
# Here's a spec that ensures there are no smell warnings in the current project:
|
@@ -17,6 +21,12 @@ module Reek
|
|
17
21
|
# end
|
18
22
|
# end
|
19
23
|
#
|
24
|
+
# And here's an even simpler way to do the same:
|
25
|
+
#
|
26
|
+
# it 'has no code smells' do
|
27
|
+
# Dir['lib/**/*.rb'].should_not reek
|
28
|
+
# end
|
29
|
+
#
|
20
30
|
# Here's a simple check of a code fragment:
|
21
31
|
#
|
22
32
|
# 'def equals(other) other.thing == self.thing end'.should_not reek
|
@@ -128,3 +138,9 @@ module Reek
|
|
128
138
|
end
|
129
139
|
end
|
130
140
|
end
|
141
|
+
|
142
|
+
if Object.const_defined?(:Spec)
|
143
|
+
Spec::Runner.configure do |config|
|
144
|
+
config.include(Reek::Spec)
|
145
|
+
end
|
146
|
+
end
|
data/lib/reek.rb
CHANGED
data/spec/spec_helper.rb
CHANGED