Make sure we reset global in specs.

This commit is contained in:
Guo Xiang Tan 2016-09-05 18:14:28 +08:00
parent 87e84756f0
commit 1f70fc9e11
1 changed files with 7 additions and 2 deletions

View File

@ -5,8 +5,13 @@ describe DiscourseEvent do
describe "#events" do describe "#events" do
it "defaults to {}" do it "defaults to {}" do
begin
original_events = DiscourseEvent.events
DiscourseEvent.instance_variable_set(:@events, nil) DiscourseEvent.instance_variable_set(:@events, nil)
expect(DiscourseEvent.events).to eq({}) expect(DiscourseEvent.events).to eq({})
ensure
DiscourseEvent.instance_variable_set(:@events, original_events)
end
end end
describe "key value" do describe "key value" do