diff --git a/spec/config/lazy_spec.rb b/spec/config/lazy_spec.rb new file mode 100644 index 00000000..7f512333 --- /dev/null +++ b/spec/config/lazy_spec.rb @@ -0,0 +1,13 @@ +require 'helper' +RSpec.describe Pry::Config::Lazy do + let(:lazyobject) do + Class.new do + include Pry::Config::Lazy + lazy_implement({foo: proc {"bar"}}) + end.new + end + + it 'memorizes value after first call' do + expect(lazyobject.foo).to equal(lazyobject.foo) + end +end