proj4rb 2.2.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,34 +1,34 @@
1
- # encoding: UTF-8
2
-
3
- require_relative './abstract_test'
4
-
5
- class EllipsoidTest < AbstractTest
6
- def test_get_all
7
- ellipsoids = Proj::Ellipsoid.list.map {|ellipsoid| ellipsoid.id }
8
- assert(ellipsoids.include?('WGS84'))
9
- assert(ellipsoids.include?('bessel'))
10
- assert(ellipsoids.include?('lerch'))
11
- end
12
-
13
- def test_one
14
- ellipsoid = Proj::Ellipsoid.get('bessel')
15
- assert_kind_of Proj::Ellipsoid, ellipsoid
16
- assert_equal('bessel', ellipsoid.id)
17
- assert_equal('a=6377397.155', ellipsoid.major)
18
- assert_equal('rf=299.1528128', ellipsoid.ell)
19
- assert_equal('Bessel 1841', ellipsoid.name)
20
- assert_equal('bessel', ellipsoid.to_s)
21
- assert_equal('#<Proj::Ellipsoid id="bessel", major="a=6377397.155", ell="rf=299.1528128", name="Bessel 1841">', ellipsoid.inspect)
22
- end
23
-
24
- def test_equal
25
- e1 = Proj::Ellipsoid.get('bessel')
26
- e2 = Proj::Ellipsoid.get('bessel')
27
- assert e1 == e2
28
- end
29
-
30
- def test_failed_get
31
- ellipsoid = Proj::Ellipsoid.get('foo')
32
- assert_nil ellipsoid
33
- end
34
- end
1
+ # encoding: UTF-8
2
+
3
+ require_relative './abstract_test'
4
+
5
+ class EllipsoidTest < AbstractTest
6
+ def test_get_all
7
+ ellipsoids = Proj::Ellipsoid.list.map {|ellipsoid| ellipsoid.id }
8
+ assert(ellipsoids.include?('WGS84'))
9
+ assert(ellipsoids.include?('bessel'))
10
+ assert(ellipsoids.include?('lerch'))
11
+ end
12
+
13
+ def test_one
14
+ ellipsoid = Proj::Ellipsoid.get('bessel')
15
+ assert_kind_of Proj::Ellipsoid, ellipsoid
16
+ assert_equal('bessel', ellipsoid.id)
17
+ assert_equal('a=6377397.155', ellipsoid.major)
18
+ assert_equal('rf=299.1528128', ellipsoid.ell)
19
+ assert_equal('Bessel 1841', ellipsoid.name)
20
+ assert_equal('bessel', ellipsoid.to_s)
21
+ assert_equal('#<Proj::Ellipsoid id="bessel", major="a=6377397.155", ell="rf=299.1528128", name="Bessel 1841">', ellipsoid.inspect)
22
+ end
23
+
24
+ def test_equal
25
+ e1 = Proj::Ellipsoid.get('bessel')
26
+ e2 = Proj::Ellipsoid.get('bessel')
27
+ assert e1 == e2
28
+ end
29
+
30
+ def test_failed_get
31
+ ellipsoid = Proj::Ellipsoid.get('foo')
32
+ assert_nil ellipsoid
33
+ end
34
+ end
@@ -1,29 +1,29 @@
1
- # encoding: UTF-8
2
-
3
- require_relative './abstract_test'
4
-
5
- class OperationTest < AbstractTest
6
- def test_get_all
7
- operations = Proj::Operation.list.map {|operation| operation.id}
8
- assert(operations.include?('aea'))
9
- assert(operations.include?('wintri'))
10
- end
11
-
12
- def test_one
13
- operation = Proj::Operation.get('rouss')
14
- assert_kind_of(Proj::Operation, operation)
15
- assert_equal('rouss', operation.id)
16
- assert_equal("Roussilhe Stereographic\n\tAzi, Ell", operation.description)
17
- end
18
-
19
- def test_equal
20
- e1 = Proj::Operation.get('rouss')
21
- e2 = Proj::Operation.get('rouss')
22
- assert(e1 == e2)
23
- end
24
-
25
- def test_failed_get
26
- operation = Proj::Operation.get('foo')
27
- assert_nil(operation)
28
- end
29
- end
1
+ # encoding: UTF-8
2
+
3
+ require_relative './abstract_test'
4
+
5
+ class OperationTest < AbstractTest
6
+ def test_get_all
7
+ operations = Proj::Operation.list.map {|operation| operation.id}
8
+ assert(operations.include?('aea'))
9
+ assert(operations.include?('wintri'))
10
+ end
11
+
12
+ def test_one
13
+ operation = Proj::Operation.get('rouss')
14
+ assert_kind_of(Proj::Operation, operation)
15
+ assert_equal('rouss', operation.id)
16
+ assert_equal("Roussilhe Stereographic\n\tAzi, Ell", operation.description)
17
+ end
18
+
19
+ def test_equal
20
+ e1 = Proj::Operation.get('rouss')
21
+ e2 = Proj::Operation.get('rouss')
22
+ assert(e1 == e2)
23
+ end
24
+
25
+ def test_failed_get
26
+ operation = Proj::Operation.get('foo')
27
+ assert_nil(operation)
28
+ end
29
+ end
@@ -1,33 +1,33 @@
1
- # encoding: UTF-8
2
-
3
- require_relative './abstract_test'
4
-
5
- class PrimeMeridiansTest < AbstractTest
6
- def test_get_all
7
- prime_meridians = Proj::PrimeMeridian.list.sort.collect {|prime_meridian| prime_meridian.id}
8
- assert prime_meridians.index('greenwich')
9
- assert prime_meridians.index('athens')
10
- assert prime_meridians.index('lisbon')
11
- assert prime_meridians.index('rome')
12
- end
13
-
14
- def test_one
15
- prime_meridian = Proj::PrimeMeridian.get('lisbon')
16
- assert_kind_of(Proj::PrimeMeridian, prime_meridian)
17
- assert_equal('lisbon', prime_meridian.id)
18
- assert_equal('9d07\'54.862"W', prime_meridian.defn)
19
- assert_equal('#<Proj::PrimeMeridian id="lisbon", defn="9d07\'54.862"W">', prime_meridian.inspect)
20
- end
21
-
22
- def test_compare
23
- u1 = Proj::PrimeMeridian.get('lisbon')
24
- u2 = Proj::PrimeMeridian.get('lisbon')
25
- assert u1 == u2
26
- end
27
-
28
- def test_failed_get
29
- prime_meridian = Proj::PrimeMeridian.get('foo')
30
- assert_nil prime_meridian
31
- end
32
- end
33
-
1
+ # encoding: UTF-8
2
+
3
+ require_relative './abstract_test'
4
+
5
+ class PrimeMeridiansTest < AbstractTest
6
+ def test_get_all
7
+ prime_meridians = Proj::PrimeMeridian.list.sort.collect {|prime_meridian| prime_meridian.id}
8
+ assert prime_meridians.index('greenwich')
9
+ assert prime_meridians.index('athens')
10
+ assert prime_meridians.index('lisbon')
11
+ assert prime_meridians.index('rome')
12
+ end
13
+
14
+ def test_one
15
+ prime_meridian = Proj::PrimeMeridian.get('lisbon')
16
+ assert_kind_of(Proj::PrimeMeridian, prime_meridian)
17
+ assert_equal('lisbon', prime_meridian.id)
18
+ assert_equal('9d07\'54.862"W', prime_meridian.defn)
19
+ assert_equal('#<Proj::PrimeMeridian id="lisbon", defn="9d07\'54.862"W">', prime_meridian.inspect)
20
+ end
21
+
22
+ def test_compare
23
+ u1 = Proj::PrimeMeridian.get('lisbon')
24
+ u2 = Proj::PrimeMeridian.get('lisbon')
25
+ assert u1 == u2
26
+ end
27
+
28
+ def test_failed_get
29
+ prime_meridian = Proj::PrimeMeridian.get('foo')
30
+ assert_nil prime_meridian
31
+ end
32
+ end
33
+
data/test/proj_test.rb CHANGED
@@ -1,17 +1,17 @@
1
- # encoding: UTF-8
2
-
3
- require_relative './abstract_test'
4
-
5
- class ProjTest < AbstractTest
6
- def test_info
7
- info = Proj.info
8
- assert_equal(6, info[:major])
9
- assert_equal(2, info[:minor])
10
- assert_equal(1, info[:patch])
11
- assert_equal('Rel. 6.2.1, November 1st, 2019', info[:release])
12
- assert_equal('6.2.1', info[:version])
13
- refute_nil(info[:searchpath])
14
- refute(info[:paths].null?)
15
- assert_equal(1, info[:path_count])
16
- end
1
+ # encoding: UTF-8
2
+
3
+ require_relative './abstract_test'
4
+
5
+ class ProjTest < AbstractTest
6
+ def test_info
7
+ info = Proj.info
8
+ assert([4,6,7,8].include?(info[:major]))
9
+ assert([0,1,2,3].include?(info[:minor]))
10
+ assert([0,1,2,3].include?(info[:patch]))
11
+ refute_nil(info[:release])
12
+ assert_match(/\d\.\d\.\d/, info[:version])
13
+ refute_nil(info[:searchpath])
14
+ refute(info[:paths].null?)
15
+ assert_equal(1, info[:path_count])
16
+ end
17
17
  end