mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Remove DiscourseEvent.clear
.
This commit is contained in:
parent
e0a2346b92
commit
aa9decf6fd
4 changed files with 5 additions and 17 deletions
|
@ -21,8 +21,4 @@ module DiscourseEvent
|
|||
events[event_name].delete(block)
|
||||
end
|
||||
|
||||
def self.clear
|
||||
@events = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -16,14 +16,6 @@ describe DiscourseEvent do
|
|||
end
|
||||
end
|
||||
|
||||
describe ".clear" do
|
||||
it "clears out events" do
|
||||
DiscourseEvent.events["event42"] << "test event"
|
||||
DiscourseEvent.clear
|
||||
expect(DiscourseEvent.events).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
context 'when calling events' do
|
||||
|
||||
let(:harvey) {
|
||||
|
|
|
@ -14,10 +14,6 @@ describe DiscoursePlugin do
|
|||
let(:registry) { mock }
|
||||
let(:plugin) { TestPlugin.new(registry) }
|
||||
|
||||
after do
|
||||
DiscourseEvent.clear
|
||||
end
|
||||
|
||||
describe ".mixins" do
|
||||
it "finds its mixins" do
|
||||
expect(TestPlugin.mixins).to eq([TestPlugin::TestMixin])
|
||||
|
@ -45,6 +41,10 @@ describe DiscoursePlugin do
|
|||
plugin.listen_for(:hello)
|
||||
end
|
||||
|
||||
after do
|
||||
DiscourseEvent.off(:hello)
|
||||
end
|
||||
|
||||
it "calls the method when it is triggered" do
|
||||
plugin.expects(:hello).with('there')
|
||||
DiscourseEvent.trigger(:hello, 'there')
|
||||
|
|
|
@ -56,7 +56,7 @@ describe Plugin::Instance do
|
|||
end
|
||||
|
||||
after do
|
||||
DiscourseEvent.clear
|
||||
DiscourseEvent.off(:hello)
|
||||
end
|
||||
|
||||
it "checks enabled/disabled functionality for extensions" do
|
||||
|
|
Loading…
Reference in a new issue