[Libguestfs] [PATCH 2/2] ruby: tests: Give each test class and method a unique name.

Richard W.M. Jones
Tue, 07 Jun 2016 21:35:33 -0000

'tc_410_close_event.rb' was not being run.  You could prove this by
simply inserting "exit 1" into that test.

The reason is unclear, but by renaming every class and method in the
tests to be unique, this ensures the tests are run.
---
 ruby/t/tc_010_load.rb              | 4 ++--
 ruby/t/tc_020_create.rb            | 4 ++--
 ruby/t/tc_030_create_flags.rb      | 4 ++--
 ruby/t/tc_040_create_multiple.rb   | 4 ++--
 ruby/t/tc_050_handle_properties.rb | 4 ++--
 ruby/t/tc_060_explicit_close.rb    | 4 ++--
 ruby/t/tc_070_optargs.rb           | 4 ++--
 ruby/t/tc_090_retvalues.rb         | 4 ++--
 ruby/t/tc_100_launch.rb            | 4 ++--
 ruby/t/tc_410_close_event.rb       | 4 ++--
 ruby/t/tc_420_log_messages.rb      | 4 ++--
 ruby/t/tc_800_rhbz507346.rb        | 4 ++--
 ruby/t/tc_810_rhbz664558c6.rb      | 4 ++--
 ruby/t/tc_820_rhbz1046509.rb       | 4 ++--
 14 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/ruby/t/tc_010_load.rb b/ruby/t/tc_010_load.rb
index 2ec0314..06922e1 100644
--- a/ruby/t/tc_010_load.rb
+++ b/ruby/t/tc_010_load.rb
@@ -17,7 +17,7 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_load
+class Test010Load < MiniTest::Unit::TestCase
+  def test_010_load
   end
 end
diff --git a/ruby/t/tc_020_create.rb b/ruby/t/tc_020_create.rb
index a2a01a1..251512b 100644
--- a/ruby/t/tc_020_create.rb
+++ b/ruby/t/tc_020_create.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_create
+class Test020Create < MiniTest::Unit::TestCase
+  def test_020_create
     g = Guestfs::Guestfs.new()
     refute_nil (g)
   end
diff --git a/ruby/t/tc_030_create_flags.rb b/ruby/t/tc_030_create_flags.rb
index 405326f..c89d3ac 100644
--- a/ruby/t/tc_030_create_flags.rb
+++ b/ruby/t/tc_030_create_flags.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_create_flags
+class Test030CreateFlags < MiniTest::Unit::TestCase
+  def test_030_create_flags
     g = Guestfs::Guestfs.new(:environment => false, :close_on_exit =>
true)
     refute_nil (g)
     g.parse_environment()
diff --git a/ruby/t/tc_040_create_multiple.rb b/ruby/t/tc_040_create_multiple.rb
index 16c67d3..e832989 100644
--- a/ruby/t/tc_040_create_multiple.rb
+++ b/ruby/t/tc_040_create_multiple.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_create_multiple
+class Test040CreateMultiple < MiniTest::Unit::TestCase
+  def test_040_create_multiple
     g1 = Guestfs::Guestfs.new()
     g2 = Guestfs::Guestfs.new()
     g3 = Guestfs::Guestfs.new()
diff --git a/ruby/t/tc_050_handle_properties.rb
b/ruby/t/tc_050_handle_properties.rb
index bcf3406..d8fddb0 100644
--- a/ruby/t/tc_050_handle_properties.rb
+++ b/ruby/t/tc_050_handle_properties.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_handle_properties
+class Test050HandleProperties < MiniTest::Unit::TestCase
+  def test_050_handle_properties
     g = Guestfs::Guestfs.new()
     refute_nil (g)
     v = g.get_verbose()
diff --git a/ruby/t/tc_060_explicit_close.rb b/ruby/t/tc_060_explicit_close.rb
index a4effd5..37e09f4 100644
--- a/ruby/t/tc_060_explicit_close.rb
+++ b/ruby/t/tc_060_explicit_close.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_explicit_close
+class Test060ExplicitClose < MiniTest::Unit::TestCase
+  def test_060_explicit_close
     g = Guestfs::Guestfs.new()
     refute_nil (g)
     g.close()
diff --git a/ruby/t/tc_070_optargs.rb b/ruby/t/tc_070_optargs.rb
index b08220d..d24aebd 100644
--- a/ruby/t/tc_070_optargs.rb
+++ b/ruby/t/tc_070_optargs.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_optargs
+class Test070Optargs < MiniTest::Unit::TestCase
+  def test_070_optargs
     g = Guestfs::Guestfs.new()

     g.add_drive("/dev/null", {})
diff --git a/ruby/t/tc_090_retvalues.rb b/ruby/t/tc_090_retvalues.rb
index 1fcc12d..4bcc8b5 100644
--- a/ruby/t/tc_090_retvalues.rb
+++ b/ruby/t/tc_090_retvalues.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_rint
+class Test090RetValues < MiniTest::Unit::TestCase
+  def test_090_retvalues
     g = Guestfs::Guestfs.new()

     assert_equal 10, g.internal_test_rint("10")
diff --git a/ruby/t/tc_100_launch.rb b/ruby/t/tc_100_launch.rb
index b79b984..1f89023 100644
--- a/ruby/t/tc_100_launch.rb
+++ b/ruby/t/tc_100_launch.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_launch
+class Test100Launch < MiniTest::Unit::TestCase
+  def test_100_launch
     g = Guestfs::Guestfs.new()

     g.add_drive_scratch(500*1024*1024)
diff --git a/ruby/t/tc_410_close_event.rb b/ruby/t/tc_410_close_event.rb
index be62b91..b77d44f 100644
--- a/ruby/t/tc_410_close_event.rb
+++ b/ruby/t/tc_410_close_event.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_events
+class Test410CloseEvent < MiniTest::Unit::TestCase
+  def test_410_close_event
     g = Guestfs::Guestfs.new()

     close_invoked = 0
diff --git a/ruby/t/tc_420_log_messages.rb b/ruby/t/tc_420_log_messages.rb
index e64ea74..44355fd 100644
--- a/ruby/t/tc_420_log_messages.rb
+++ b/ruby/t/tc_420_log_messages.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_events
+class Test420LogMessages < MiniTest::Unit::TestCase
+  def test_420_log_messages
     g = Guestfs::Guestfs.new()

     log_invoked = 0
diff --git a/ruby/t/tc_800_rhbz507346.rb b/ruby/t/tc_800_rhbz507346.rb
index eb516fb..60dd345 100644
--- a/ruby/t/tc_800_rhbz507346.rb
+++ b/ruby/t/tc_800_rhbz507346.rb
@@ -17,8 +17,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_rhbz507346
+class Test800RHBZ507346 < MiniTest::Unit::TestCase
+  def test_800_rhbz507346
     g = Guestfs::Guestfs.new()
     g.add_drive_scratch(10*1024*1024)
     g.launch()
diff --git a/ruby/t/tc_810_rhbz664558c6.rb b/ruby/t/tc_810_rhbz664558c6.rb
index 347e403..dc7e9e4 100644
--- a/ruby/t/tc_810_rhbz664558c6.rb
+++ b/ruby/t/tc_810_rhbz664558c6.rb
@@ -21,8 +21,8 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
-  def test_rhbz664558c6
+class Test810RHBZ664558C6 < MiniTest::Unit::TestCase
+  def test_810_rhbz_664558c6
     g = Guestfs::Guestfs.new()

     close_invoked = 0
diff --git a/ruby/t/tc_820_rhbz1046509.rb b/ruby/t/tc_820_rhbz1046509.rb
index c15f7a7..eb06eab 100644
--- a/ruby/t/tc_820_rhbz1046509.rb
+++ b/ruby/t/tc_820_rhbz1046509.rb
@@ -20,13 +20,13 @@

 require File::join(File::dirname(__FILE__), 'test_helper')

-class TestLoad < MiniTest::Unit::TestCase
+class Test820RHBZ1046509 < MiniTest::Unit::TestCase
   def _handleok(g)
     g.add_drive("/dev/null")
     g.close()
   end

-  def test_rhbz1046509
+  def test_820_rhbz1046509
     g = Guestfs::create()
     _handleok(g)

--
2.7.4