File: GnomeVFSVolumeMonitor

package info (click to toggle)
libgnome2-vfs-perl 1.060-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 464 kB
  • ctags: 71
  • sloc: perl: 1,188; ansic: 446; makefile: 53
file content (39 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl -w
use strict;
use Gnome2::VFS;

use Test::More;

# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gnome2-VFS/t/GnomeVFSVolumeMonitor,v 1.1 2004/07/29 17:36:03 kaffeetisch Exp $

unless (-d "$ENV{ HOME }/.gnome") {
  plan(skip_all => "You have no ~/.gnome");
}

unless (Gnome2::VFS -> CHECK_VERSION(2, 6, 0)) {
  plan(skip_all => "This is new in 2.6");
}

plan(tests => 6);

Gnome2::VFS -> init();

###############################################################################

my $monitor = Gnome2::VFS -> get_volume_monitor();
isa_ok($monitor, "Gnome2::VFS::VolumeMonitor");

my @volumes = $monitor -> get_mounted_volumes();
isa_ok($volumes[0], "Gnome2::VFS::Volume");

my @drives = $monitor -> get_connected_drives();
isa_ok($drives[0], "Gnome2::VFS::Drive");

isa_ok($monitor -> get_volume_for_path("/dev/cdrom"), "Gnome2::VFS::Volume");

is($monitor -> get_volume_by_id($volumes[0] -> get_id()), $volumes[0]);
is($monitor -> get_drive_by_id($drives[0] -> get_id()), $drives[0]);

###############################################################################

Gnome2::VFS -> shutdown();