diff --git a/spec/line_editor/readline_spec.rb b/spec/line_editor/readline_spec.rb index 86cf7466e..7ab67aaa9 100644 --- a/spec/line_editor/readline_spec.rb +++ b/spec/line_editor/readline_spec.rb @@ -2,6 +2,8 @@ describe Thor::LineEditor::Readline do before do + # Eagerly check Readline availability before mocking + Thor::LineEditor::Readline.available? unless defined? ::Readline ::Readline = double("Readline") allow(::Readline).to receive(:completion_append_character=).with(nil)