ruby-rpm 1.2.4 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,60 +0,0 @@
1
- require 'test/unit'
2
- require 'rpm'
3
-
4
- class RPM_Version_Tests < Test::Unit::TestCase
5
- def setup
6
- @a = RPM::Version.new( '1.0.0-0.1m' )
7
- @b = RPM::Version.new( '0.9.0-1m' )
8
- @c = RPM::Version.new( '1.0.0-0.11m' )
9
- @d = RPM::Version.new( '0.9.0-1m', 1)
10
- end
11
-
12
- def test_version_compare
13
- assert( @a > @b )
14
- assert( @a < @c )
15
- assert( @a < @d )
16
- end
17
-
18
- def test_version_newer?
19
- assert( @a.newer?(@b) )
20
- assert( @c.newer?(@a) )
21
- assert( @d.newer?(@a) )
22
- end
23
-
24
- def test_version_older?
25
- assert( @b.older?(@a) )
26
- assert( @a.older?(@c) )
27
- assert( @a.older?(@d) )
28
- end
29
-
30
- def test_vre
31
- assert_equal( '0.9.0', @d.v )
32
- assert_equal( '1m', @d.r )
33
- assert_equal( 1, @d.e )
34
- end
35
-
36
- def test_to_s
37
- assert_equal( '0.9.0-1m', @b.to_s )
38
- assert_equal( '0.9.0-1m', @d.to_s )
39
- end
40
-
41
- def test_to_vre
42
- assert_equal( '0.9.0-1m', @b.to_vre )
43
- assert_equal( '1:0.9.0-1m', @d.to_vre )
44
- end
45
-
46
- def test_inspect
47
- v = RPM::Version.new("1", "2", 3)
48
- assert_equal(3, v.e)
49
- assert_equal('#<RPM::Version v="1", r="2", e=3>', v.inspect)
50
- end
51
-
52
- def test_epoch_none_zero
53
- v1 = RPM::Version.new("1-2")
54
- v2 = RPM::Version.new("0:1-2")
55
- assert_equal(nil, v1.e)
56
- assert_equal(0, v2.e)
57
- assert( v1 == v2 )
58
- assert_equal(v1.hash, v2.hash)
59
- end
60
- end