Os tests covering all possible, valid operating systems. Also has 100% test coverage
This commit is contained in:
parent
e32bacc2b5
commit
052d0ddb15
1 changed files with 32 additions and 3 deletions
|
|
@ -14,10 +14,39 @@ use lib "$FindBin::Bin/../lib";
|
|||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Session::Os;
|
||||
|
||||
use Test::More tests => 2; # increment this value for each test you create
|
||||
my @testSets = (
|
||||
{
|
||||
os => 'Win',
|
||||
type => 'Windowsish',
|
||||
},
|
||||
{
|
||||
os => 'win32',
|
||||
type => 'Windowsish',
|
||||
},
|
||||
{
|
||||
os => 'MSWin32',
|
||||
type => 'Windowsish',
|
||||
},
|
||||
{
|
||||
os => 'Amiga OS',
|
||||
type => 'Linuxish',
|
||||
},
|
||||
);
|
||||
|
||||
use Test::More;
|
||||
|
||||
my $numTests = 2 * scalar @testSets;
|
||||
|
||||
plan tests => $numTests;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
ok($session->os->get("name") ne "", "get(name)");
|
||||
ok($session->os->get("type") eq "Windowsish" || $session->os->get("type") eq "Linuxish", "get(type)");
|
||||
foreach my $test (@testSets) {
|
||||
local $^O = $test->{os};
|
||||
my $os = WebGUI::Session::Os->new($session);
|
||||
is($os->get('name'), $test->{os}, "$test->{os}: name set");
|
||||
is($os->get('type'), $test->{type}, "$test->{os}: type set");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue