Skip to content

Commit d483bc3

Browse files
committed
Emulate the reference hubot-chatops-rpc implementation
The reference hubot chatops-rpc implementation has the generic arguments (--param value) overwriting the parameter values extracted via the regular expression parsing. The change to the test here emulates that behavior. refs https://github.com/bhuga/hubot-chatops-rpc/blob/d32d185f6325eae04b432a2166a8a1fa81d296b6/src/chatops-rpc.coffee#L250-L253
1 parent ed4c691 commit d483bc3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/chatops/controller/test_case_helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def chat(message, user, room_id = "123")
5757
match_data = matcher["regex"].match(command)
5858
jsonrpc_params = named_params.dup
5959
matcher["params"].each do |param|
60-
jsonrpc_params[param] = match_data[param.to_sym]
60+
jsonrpc_params[param] ||= match_data[param.to_sym]
6161
end
6262
jsonrpc_params.merge!(user: user, room_id: room_id, mention_slug: user)
6363
chatop matcher["name"].to_sym, jsonrpc_params

0 commit comments

Comments
 (0)