lib/bunny_mock/exchanges/topic.rb in bunny-mock-1.2.0 vs lib/bunny_mock/exchanges/topic.rb in bunny-mock-1.2.1

- old
+ new

@@ -25,16 +25,16 @@ # @api public # def deliver(payload, opts, key) # escape periods with backslash for regex - key.gsub!('.', '\.') + key = key.gsub('.', '\.') # replace single wildcards with regex for a single domain - key.gsub!(SINGLE_WILDCARD, '(?:\w+)') + key = key.gsub(SINGLE_WILDCARD, '(?:\w+)') # replace multi wildcards with regex for many domains separated by '.' - key.gsub!(MULTI_WILDCARD, '\w+\.?') + key = key.gsub(MULTI_WILDCARD, '\w+\.?') # turn key into regex key = Regexp.new(key) @routes.each do |route, destination|