summaryrefslogtreecommitdiff
path: root/spec/config
diff options
context:
space:
mode:
authorstrcmp <28xdb6+fvutuvy4f@grr.la>2015-12-31 03:59:53 +0000
committerstrcmp <28xdb6+fvutuvy4f@grr.la>2015-12-31 03:59:53 +0000
commit398a62bf79d1d9e614438e8153fdd0bdfd05eaa3 (patch)
tree86cc411486257f515cd990e450f26077cd514740 /spec/config
parent983daf6fd5c592442a66b687dabf8098bc3ad049 (diff)
downloadpry-398a62bf79d1d9e614438e8153fdd0bdfd05eaa3.tar.gz
add lazy_spec.rbpry-lazy
Diffstat (limited to 'spec/config')
-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