ruby: Simplify and fix regression test.

This test failed on ppc64le with:

  Failure:
    </wrong argument type Fixnum \(expected Array\)/> was expected to be =~
    <"wrong argument type Integer (expected Array)">.

In addition the test generated a warning:

  tc_800_rhbz507346.rb:29: warning: ambiguous first argument; put parentheses or a space even after `/' operator

This commit fixes both of these and also makes it simpler and faster
by not bothering to launch the appliance.

Fixes commit 227b1eea90.
This commit is contained in:
Richard W.M. Jones
2017-03-01 15:07:00 +00:00
parent 0f99537cb6
commit 9fbdea695b

View File

@@ -20,12 +20,10 @@ require File::join(File::dirname(__FILE__), 'test_helper')
class Test800RHBZ507346 < MiniTest::Unit::TestCase
def test_800_rhbz507346
g = Guestfs::Guestfs.new()
g.add_drive_scratch(10*1024*1024)
g.launch()
exception = assert_raises TypeError do
g.command(1)
g.parse_environment_list(1)
end
assert_match /wrong argument type Fixnum \(expected Array\)/, exception.message
assert_match(/wrong argument type .* \(expected Array\)/,
exception.message)
end
end