From ec90655c414d30a41f70861bcea31b99d1e401a9 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 5 Sep 2016 15:48:59 +0800 Subject: [PATCH] FIX: Clean up specs properly. --- spec/components/plugin/instance_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/components/plugin/instance_spec.rb b/spec/components/plugin/instance_spec.rb index a6d850ba16e..df5fba1ec28 100644 --- a/spec/components/plugin/instance_spec.rb +++ b/spec/components/plugin/instance_spec.rb @@ -48,7 +48,8 @@ describe Plugin::Instance do # DiscourseEvent @hello_count = 0 - @plugin.on(:hello) { @hello_count += 1 } + @increase_count = -> { @hello_count += 1 } + @plugin.on(:hello, &@increase_count) # Serializer @plugin.add_to_serializer(:trout, :scales) { 1024 } @@ -56,7 +57,7 @@ describe Plugin::Instance do end after do - DiscourseEvent.off(:hello) + DiscourseEvent.off(:hello, &@increase_count) end it "checks enabled/disabled functionality for extensions" do