Project

General

Profile

Actions

Bug #19573

closed

assert_match on CommandExpectation raises exception

Added by Tomáš Strachota over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

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 #1

Updated by The Foreman Bot over 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/241 added
Actions #2

Updated by Marek Hulán over 7 years ago

  • Target version changed from 1.13.4 to 1.14.0
Actions #3

Updated by Marek Hulán over 7 years ago

  • Target version changed from 1.14.0 to 1.14.3
Actions #4

Updated by Anonymous over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #5

Updated by Tomáš Strachota over 7 years ago

  • Translation missing: en.field_release set to 242
Actions

Also available in: Atom PDF