File: autoload.t

package info (click to toggle)
libchemistry-elements-perl 1.075-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 264 kB
  • sloc: perl: 700; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 628 bytes parent folder | download | duplicates (6)
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
#!/usr/bin/perl

use Test::More 'no_plan';

my $class = 'Chemistry::Elements';
my $sub   = 'get_symbol';

use_ok( $class, $sub );

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Object interface with something that works
{
my $element = $class->new( 'Erbium' );
isa_ok( $element, $class );

is( $element->Z,       68      );
is( $element->name,   'Erbium' );
is( $element->symbol, 'Er'     );

ok( $element->molar_mass( 167.26 ), 'Set molar mass for Er' );

ok( $element->can( 'molar_mass' ), "Now I can call molar_mass" );
	
is( $element->molar_mass, 167.26, 'Got back same value for molar mass' );
}