Skip to content

A platform for community discussion. Free, open, simple.

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

Alan Guo Xiang Tan02b84dbff22a
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.