From 6d979c1cbd4fe35e41d31e8c23b918545b255f0d Mon Sep 17 00:00:00 2001 From: Jemma Issroff Date: Tue, 14 Dec 2021 17:00:29 -0500 Subject: [PATCH] =?UTF-8?q?All=20tests=20passing=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/memo_wise_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/memo_wise_spec.rb b/spec/memo_wise_spec.rb index c3953a03..9f47c6e2 100644 --- a/spec/memo_wise_spec.rb +++ b/spec/memo_wise_spec.rb @@ -316,7 +316,7 @@ def child_method context "when the class inherits memoization from multiple modules" do let(:module1) do Module.new do - prepend MemoWise + extend MemoWise def module1_method_counter @module1_method_counter || 0 # rubocop:disable RSpec/InstanceVariable @@ -332,7 +332,7 @@ def module1_method let(:module2) do Module.new do - prepend MemoWise + extend MemoWise def module2_method_counter @module2_method_counter || 0 # rubocop:disable RSpec/InstanceVariable @@ -370,7 +370,7 @@ def module2_method context "when the class, its superclass, and its module all memoize methods" do let(:parent_class) do Class.new do - prepend MemoWise + extend MemoWise def parent_class_method_counter @parent_class_method_counter || 0 @@ -386,7 +386,7 @@ def parent_class_method let(:module1) do Module.new do - prepend MemoWise + extend MemoWise def module1_method_counter @module1_method_counter || 0 # rubocop:disable RSpec/InstanceVariable @@ -448,7 +448,7 @@ def child_class_method it "creates a class-level instance variable" do # NOTE: test implementation detail to ensure the inverse test is valid - expect(class_with_memo.instance_variables).to include(:@_memo_wise) + expect(class_with_memo.public_methods).to include(:_memo_wise) end it_behaves_like "handles memoized/non-memoized methods with the same name at different scopes" do @@ -519,7 +519,7 @@ def self.child_method it "creates a class-level instance variable" do # NOTE: this test ensure the inverse test above continues to be valid - expect(class_with_memo.instance_variables).to include(:@_memo_wise) + expect(class_with_memo.public_methods).to include(:_memo_wise) end it_behaves_like "handles memoized/non-memoized methods with the same name at different scopes" do @@ -597,7 +597,7 @@ def child_method it "creates a module-level instance variable" do # NOTE: test implementation detail to ensure the inverse test is valid - expect(module_with_memo.instance_variables).to include(:@_memo_wise) + expect(module_with_memo.public_methods).to include(:_memo_wise) end context "when an invalid hash key is passed to .memo_wise" do @@ -626,7 +626,7 @@ def self.module_method; end it "creates a module-level instance variable" do # NOTE: this test ensure the inverse test above continues to be valid - expect(module_with_memo.instance_variables).to include(:@_memo_wise) + expect(module_with_memo.public_methods).to include(:_memo_wise) end end end