5b46e14c8f189e3e50fd92a7d1232b1046a92afc
[platform/upstream/libzypp-bindings.git] / swig / ruby / tests / bytecount.rb
1 #
2 # Test Bytecount
3 #
4
5 $:.unshift "../../../build/swig/ruby"
6
7
8 # test loading of extension
9 require 'test/unit'
10
11 class LoadTest < Test::Unit::TestCase
12   require 'zypp'
13   include Zypp
14
15   def test_bytecount
16     g = ByteCount.new(ByteCount.G)
17     assert g
18     gb = ByteCount.new(ByteCount.GB)
19     assert gb
20     k = ByteCount.new(ByteCount.K)
21     assert k.to_i == 1024
22     mb = ByteCount.new(ByteCount.MB)
23     assert mb.to_i == 1000*1000
24   end
25 end