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
Kyrylo Silin 04d4f424e3 rubocop: fix offences regarding spaces
Fixes offences of the following cops:

* Layout/SpaceAroundEqualsInParameterDefault
* Layout/SpaceAroundOperators
* Layout/SpaceBeforeBlockBraces
* Layout/SpaceInsideBlockBraces
2018-11-04 17:34:24 +08:00

21 lines
502 B
Ruby

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