@@ -136,3 +136,48 @@ Feature: Reek can be driven through its Task
136136 [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
137137 [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
138138 """
139+
140+ Scenario : REEK_CFG overrides the configuration file to use
141+ Given the smelly file 'smelly.rb'
142+ And a configuration file 'empty.reek'
143+ And a configuration file 'full_mask.reek'
144+ And a file "Rakefile" with:
145+ """
146+ require 'reek/rake/task'
147+
148+ Reek::Rake::Task.new do |t|
149+ t.config_file = 'full_mask.reek'
150+ t.source_files = 'smelly.rb'
151+ t.reek_opts = '--no-color --no-documentation'
152+ end
153+ """
154+ When I set the environment variable "REEK_CFG" to "empty.reek"
155+ And I run `rake reek`
156+ Then the exit status indicates an error
157+ And it reports:
158+ """
159+ smelly.rb -- 2 warnings:
160+ [4]:UncommunicativeMethodName: Smelly#x has the name 'x'
161+ [5]:UncommunicativeVariableName: Smelly#x has the variable name 'y'
162+ """
163+
164+ Scenario : REEK_OPTS overrides options to use
165+ Given the smelly file 'smelly.rb'
166+ And a file "Rakefile" with:
167+ """
168+ require 'reek/rake/task'
169+
170+ Reek::Rake::Task.new do |t|
171+ t.source_files = 'smelly.rb'
172+ t.reek_opts = '--no-color --no-documentation'
173+ end
174+ """
175+ When I set the environment variable "REEK_OPTS" to "--single-line --no-documentation"
176+ And I run `rake reek`
177+ Then the exit status indicates an error
178+ And it reports:
179+ """
180+ smelly.rb -- 2 warnings:
181+ smelly.rb:4: UncommunicativeMethodName: Smelly#x has the name 'x'
182+ smelly.rb:5: UncommunicativeVariableName: Smelly#x has the variable name 'y'
183+ """
0 commit comments