DEV: Fix flaky instagram onebox spec by not mutating constant.

This commit is contained in:
Alan Guo Xiang Tan 2021-07-27 13:35:08 +08:00
parent c161f5e0b2
commit 02b84dbff2
1 changed files with 1 additions and 3 deletions

View File

@ -31,8 +31,6 @@ module Onebox
attr_reader :url, :uri, :options, :timeout attr_reader :url, :uri, :options, :timeout
attr :errors attr :errors
DEFAULT = {}
def options=(opt) def options=(opt)
return @options if opt.nil? # make sure options provided return @options if opt.nil? # make sure options provided
opt = opt.to_h if opt.instance_of?(OpenStruct) opt = opt.to_h if opt.instance_of?(OpenStruct)
@ -42,7 +40,7 @@ module Onebox
def initialize(url, timeout = nil) def initialize(url, timeout = nil)
@errors = {} @errors = {}
@options = DEFAULT @options = {}
class_name = self.class.name.split("::").last.to_s class_name = self.class.name.split("::").last.to_s
# Set the engine options extracted from global options. # Set the engine options extracted from global options.