Actions
Bug #19573
closedassert_match on CommandExpectation raises exception
Status:
Closed
Priority:
Normal
Assignee:
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Pull request:
Team Backlog:
Description
When HammerCLI::Testing::CommandAssertions are included into global namespace the method CommandExpectation#assert_match starts to collide with Minitest's assert_match.
This appears when CommandExpectation is used with regex for matching command's output:
expected_result = HammerCLI::Testing::CommandAssertions::CommandExpectation.new('', /.*created.*/, HammerCLI::EX_OK) result = run_cmd('organization create') assert_cmd(expected_result, result)
ArgumentError: wrong number of arguments (given 3, expected 1) /root/hammer/hammer-cli/lib/hammer_cli/testing/command_assertions.rb:15:in `assert_match' /root/hammer/hammer-cli/lib/hammer_cli/testing/command_assertions.rb:68:in `assert_equal_or_match' /root/hammer/hammer-cli/lib/hammer_cli/testing/command_assertions.rb:16:in `assert_match' /root/hammer/hammer-cli/lib/hammer_cli/testing/command_assertions.rb:57:in `assert_cmd' /root/hammer/hammer-cli-foreman-virt-who-configure/test/functional/config_test.rb:26:in `block (3 levels) in <top (required)>'
Actions