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/memoization_spec.rb

22 lines
498 B
Ruby
Raw Normal View History

require 'helper'
RSpec.describe Pry::Config::Memoization do
let(:config) do
Class.new do
include Pry::Config::Memoization
def_memoized({foo: proc {"foo"}, bar: proc {"bar"}})
end.new
end
describe "on call of method" do
it "memoizes the return value" do
expect(config.foo).to be(config.foo)
end
end
describe "#memoized_methods" do
it "tracks a list of memoized methods" do
expect(config.memoized_methods).to eq([:foo, :bar])
end
end
end