mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
fix 'at least one lazy method has to be called before #lazy_keys could ..'
This commit is contained in:
parent
f95d65171e
commit
c584d173a1
2 changed files with 1 additions and 2 deletions
|
@ -6,12 +6,12 @@ module Pry::Config::Lazy
|
|||
method_name_to_func.each do |method_name, func|
|
||||
define_method(method_name) do
|
||||
if method_name_to_func[method_name].equal?(func)
|
||||
LAZY_KEYS[self.class] |= method_name_to_func.keys
|
||||
method_name_to_func[method_name] = instance_eval(&func)
|
||||
end
|
||||
method_name_to_func[method_name]
|
||||
end
|
||||
end
|
||||
LAZY_KEYS[self] |= method_name_to_func.keys
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ RSpec.describe Pry::Config::Lazy do
|
|||
|
||||
describe "#lazy_keys" do
|
||||
it "tracks a list of lazy keys" do
|
||||
lazyobj.foo # at least one lazy method has to be called before #lazy_keys could return a non-empty array.
|
||||
expect(lazyobj.lazy_keys).to eq([:foo, :bar])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue