Skip to content

Commit 4696759

Browse files
committed
Silence method redefined warnings when reloading thorfiles
This silences the warnings when the Thor specs are run but will still be there when used by the end user, so it may need revisiting if we want to eliminate warnings when using Thor as well as when testing it.
1 parent c9d4e5a commit 4696759

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/runner_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,16 @@ def when_no_thorfiles_exist
229229
else
230230
expect(File).to receive(:delete).with(path)
231231
end
232-
silence(:stdout) { Thor::Runner.start(%w[update random]) }
232+
silence_warnings do
233+
silence(:stdout) { Thor::Runner.start(%w[update random]) }
234+
end
233235
end
234236

235237
it 'installs thor files' do
236238
ARGV.replace %W[install #{@location}]
237-
silence(:stdout) { Thor::Runner.start }
239+
silence_warnings do
240+
silence(:stdout) { Thor::Runner.start }
241+
end
238242
end
239243
end
240244
end

0 commit comments

Comments
 (0)