Fix spec by removing global state.

This commit is contained in:
Douwe Maan 2015-08-20 16:21:31 -07:00
parent afb765ad9e
commit 3d141d1512

View file

@ -36,14 +36,12 @@ module Gitlab
end end
def address_regex def address_regex
@address_regex ||= begin wildcard_address = config.address
wildcard_address = config.address return nil unless wildcard_address
return nil unless wildcard_address
regex = Regexp.escape(wildcard_address) regex = Regexp.escape(wildcard_address)
regex = regex.gsub(Regexp.escape('%{reply_key}'), "(.+)") regex = regex.gsub(Regexp.escape('%{reply_key}'), "(.+)")
Regexp.new(regex).freeze Regexp.new(regex).freeze
end
end end
end end
end end