Remove `DiscourseEvent.clear`.
This commit is contained in:
parent
e0a2346b92
commit
aa9decf6fd
|
@ -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 New Issue