From 02b84dbff22a21aa06c6ed4bc94a7c826fe4cdd3 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 27 Jul 2021 13:35:08 +0800 Subject: [PATCH] DEV: Fix flaky instagram onebox spec by not mutating constant. --- lib/onebox/engine.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/onebox/engine.rb b/lib/onebox/engine.rb index cdd3adc2451..f1b9196ce20 100644 --- a/lib/onebox/engine.rb +++ b/lib/onebox/engine.rb @@ -31,8 +31,6 @@ module Onebox attr_reader :url, :uri, :options, :timeout attr :errors - DEFAULT = {} - def options=(opt) return @options if opt.nil? # make sure options provided opt = opt.to_h if opt.instance_of?(OpenStruct) @@ -42,7 +40,7 @@ module Onebox def initialize(url, timeout = nil) @errors = {} - @options = DEFAULT + @options = {} class_name = self.class.name.split("::").last.to_s # Set the engine options extracted from global options.