22 Commits

Author SHA1 Message Date
Richard W.M. Jones
72cfaff5c5 Update copyright dates for 2025
Automated using this command:

perl -pi.bak -e 's/(20[012][0-9])-20[12][01234]/$1-2025/g' `git ls-files`
2025-02-16 17:00:46 +00:00
Richard W.M. Jones
ecf361d723 ruby: Get rid of old Test::Unit compatibility
See this commit in hivex:
6dbbc474d3
2023-09-21 15:21:18 +01:00
Richard W.M. Jones
d25a48e2dd ruby: Replace MiniTest with Minitest
See this commit in hivex:
fbcff7fbd8
2023-09-21 15:16:51 +01:00
Richard W.M. Jones
e2c7bddf10 Update copyright dates for 2023
Run this command across the source:

  perl -pi.bak -e 's/(20[012][0-9])-20[12][012]/$1-2023/g' `git ls-files`

and remove changes to po{,-docs}/*.po{,t} (these will be regenerated
later when we run 'make dist').
2023-02-07 10:50:48 +00:00
Richard W.M. Jones
0e17236d7d Update copyright dates to 2020. 2020-03-06 19:32:32 +00:00
Csaba Henk
83474887ed ruby: change value of 'readonly' drive toption to Boolean in doc/example/test
Seeing `g.add_drive_opt :readonly => 1` allows one to imply
that ensuring writable access to drive should happen via
`g.add_drive_opt :readonly => 0`. However, the passed option
value gets passed down to C according to Ruby Boolean semantics,
that is, any value apart from `false` and `nil` will be true
(see RTEST in Ruby C API).

So its more idiomatic and provides a better hint if we use
`g.add_drive_opt :readonly => true` in Ruby samples.
2020-02-19 18:27:02 +00:00
Richard W.M. Jones
05d4fcb64d Update copyright dates for 2019.
This command run over the source:

perl -pi.bak -e 's/(20[01][0-9])-2018/$1-2019/g' `git ls-files`
2019-01-08 11:58:30 +00:00
Richard W.M. Jones
212762c593 Update copyright dates for 2018.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2017/$1-2018/g' `git ls-files`
2018-01-04 15:30:10 +00:00
Richard W.M. Jones
9fbdea695b 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.
2017-03-01 15:07:00 +00:00
Pino Toscano
55bf7de97c Update copyright dates for 2017
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2016/$1-2017/g' `git ls-files`

(Thanks Rich for the perl snippet, as used in past years.)
2017-01-03 16:48:21 +01:00
Richard W.M. Jones
4ed70d558a ruby: tests: Give each test class and method a unique name.
'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.
2016-06-10 14:25:38 +01:00
Pino Toscano
b1ae32416e ruby: tests: use more asserts instead of manual checks
Make more use of assert_equal/refute_equal instead of manually checking
values and raising errors.
2016-02-23 11:50:35 +01:00
Pino Toscano
f7765ea6e4 Start adding return values tests for bindings
Introduce a new kind of bindings tests, 090-retvalues, to check all the
possible return values in bindings; start implementing them for
scripting languages such as GObject introspection, Perl, PHP, Python,
and Ruby, reusing existing implementations where existing.
2016-02-15 18:32:07 +01:00
Richard W.M. Jones
307c83177c Update copyright dates for 2016.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2015/$1-2016/g' `git ls-files`
2016-01-02 21:19:51 +00:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Pino Toscano
2f5e9066db ruby: tests: convert from Test::Unit to MiniTest (RHBZ#1085029)
Convert the tests to the MiniTest test framework, but keeping the usage
of the old Test::Unit as fallback in case MiniTest is not available.
In the latter case, use a bit of "glue" to make the old API look like
the new API, so we can just rely on the newer MiniTest API.
2014-04-22 14:02:35 +02:00
Pino Toscano
fbae7f3e69 ruby: tests: isolate boilerplate in common file
Isolate in a common file all the standard boilerplate in tests, i.e. the
import of the test framework and the guestfs module (including the
import path hack needed for the latter).

Thanks to Vít Ondruch for the precious hints and suggestions.
2014-04-22 14:02:29 +02:00
Richard W.M. Jones
6c971faecf Update copyright dates for 2014. 2014-01-02 16:53:34 +00:00
Richard W.M. Jones
ee4ce2a029 ruby: Fix .new method (RHBZ#1046509).
The .new method was unintentionally broken in
commit 9466060201.

This fixes the .new method and allows it to be called with multiple
parameters, so you can use:

  Guestfs::Guestfs.new
  Guestfs::Guestfs.new()
  Guestfs::Guestfs.new(:close_on_exit => false)
  etc.

For backwards compatibility, Guestfs::create may still be used.

This commit also adds regression tests:

 - Use .new method in regular tests.  (Because this was not done
   before, we didn't catch the breakage.)

 - Test that ::create still works.

 - Test that args can be passed to .new method.
2013-12-27 13:22:20 +00:00
Richard W.M. Jones
92e1864913 events: Add a warning event and direct all warning messages through it.
This also causes warnings to be printed even in non-verbose mode,
which is useful.
2013-10-11 15:34:23 +01:00
Richard W.M. Jones
14fabcd88e tests: Use new guestfs_add_drive_scratch API where possible in tests.
Replaces code such as:

  fd = open "test1.img"
  ftruncate fd, size
  close fd
  g.add_drive "test1.img"

with the shorter and simpler:

  g.add_drive_scratch size
2013-07-20 16:31:42 +01:00
Richard W.M. Jones
3c43019f8d ruby: Standardize test names and numbering. 2013-04-30 17:47:11 +01:00