File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 11require "helper"
2+ require "readline"
23
34describe Thor ::LineEditor , "on a system with Readline support" do
45 before do
5- @original_readline = ::Readline if defined? ::Readline
6- silence_warnings { ::Readline = double ( "Readline" ) }
6+ @original_readline = ::Readline
7+ Object . send ( :remove_const , :Readline )
8+ ::Readline = double ( "Readline" )
79 end
810
911 after do
10- silence_warnings { ::Readline = @original_readline }
12+ Object . send ( :remove_const , :Readline )
13+ ::Readline = @original_readline
1114 end
1215
1316 describe ".readline" do
2225
2326describe Thor ::LineEditor , "on a system without Readline support" do
2427 before do
25- if defined? ::Readline
26- @original_readline = ::Readline
27- Object . send ( :remove_const , :Readline )
28- end
28+ @original_readline = ::Readline
29+ Object . send ( :remove_const , :Readline )
2930 end
3031
3132 after do
32- silence_warnings { ::Readline = @original_readline }
33+ ::Readline = @original_readline
3334 end
3435
3536 describe ".readline" do
You can’t perform that action at this time.
0 commit comments