1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/spec/config/lazy_spec.rb

21 lines
476 B
Ruby

require 'helper'
RSpec.describe Pry::Config::Lazy do
let(:lazyobj) do
Class.new do
include Pry::Config::Lazy
lazy_implement({foo: proc {"foo"}, bar: proc {"bar"}})
end.new
end
describe "on call of a lazy method" do
it "memoizes the return value" do
expect(lazyobj.foo).to be(lazyobj.foo)
end
end
describe "#lazy_keys" do
it "tracks a list of lazy keys" do
expect(lazyobj.lazy_keys).to eq([:foo, :bar])
end
end
end