Skip to content

Commit

Permalink
Fix disapprove format
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD committed Aug 18, 2019
1 parent d88564f commit a1f5549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/analyzers/two_fer/analyze.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ def refer_to_mentor!
raise FinishedFlowControlException
end

def disapprove!(msg, *msg_args)
def disapprove!(msg, params = {})
self.status = :disapprove
if msg_args.length > 0
self.comments << [MESSAGES[msg], *msg_args]
if params.length > 0
self.comments << {comment: MESSAGES[msg], params: params}
else
self.comments << MESSAGES[msg]
end
Expand Down
3 changes: 2 additions & 1 deletion test/exercises/two_fer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def self.two_fer(*foos)
}
results = TwoFer::Analyze.(source)
assert_equal :disapprove, results[:status]
assert_equal [["ruby.two-fer.splat_args", name_variable: :foos]], results[:comments]
assert_equal [{comment: "ruby.two-fer.splat_args", params: {name_variable: :foos}}], results[:comments]

end

# ### 
Expand Down

0 comments on commit a1f5549

Please sign in to comment.