From aa1f3068948d4bbe43946723c92056c5fb78be9c Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 5 Sep 2016 16:10:03 +0800 Subject: [PATCH] Properly clean up plugin event in specs.. --- spec/components/plugin/instance_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/components/plugin/instance_spec.rb b/spec/components/plugin/instance_spec.rb index df5fba1ec..4cc5ab03c 100644 --- a/spec/components/plugin/instance_spec.rb +++ b/spec/components/plugin/instance_spec.rb @@ -49,7 +49,7 @@ describe Plugin::Instance do # DiscourseEvent @hello_count = 0 @increase_count = -> { @hello_count += 1 } - @plugin.on(:hello, &@increase_count) + @set = @plugin.on(:hello, &@increase_count) # Serializer @plugin.add_to_serializer(:trout, :scales) { 1024 } @@ -57,7 +57,7 @@ describe Plugin::Instance do end after do - DiscourseEvent.off(:hello, &@increase_count) + DiscourseEvent.off(:hello, &@set.last) end it "checks enabled/disabled functionality for extensions" do