Skip to content

Commit 4a8cdc8

Browse files
committed
Drop unneeded require memoization
1 parent ab74cfd commit 4a8cdc8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/thor/line_editor/readline.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ class Thor
22
module LineEditor
33
class Readline < Basic
44
def self.available?
5-
@readline_reqd ||= begin
6-
require "readline"
5+
begin
6+
require "readline"
77
rescue LoadError
88
end
99

spec/line_editor/readline_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
describe Thor::LineEditor::Readline do
44
before do
5-
# Eagerly check Readline availability and cache for this spec
5+
# Eagerly check Readline availability before mocking
66
Thor::LineEditor::Readline.available?
77
unless defined? ::Readline
88
::Readline = double("Readline")

0 commit comments

Comments
 (0)