summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/config/lazy_spec.rb13
1 files changed, 13 insertions, 0 deletions
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