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
1 changed files with 5 additions and 7 deletions

View File

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