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
it "defaults to {}" do
DiscourseEvent.instance_variable_set(:@events, nil)
expect(DiscourseEvent.events).to eq({})
begin
original_events = DiscourseEvent.events
DiscourseEvent.instance_variable_set(:@events, nil)
expect(DiscourseEvent.events).to eq({})
ensure
DiscourseEvent.instance_variable_set(:@events, original_events)
end
end
describe "key value" do