summaryrefslogtreecommitdiff
path: root/swig/ruby/tests/bytecount.rb
blob: bda6f0a9845cd39e42e20dd39fcc45b9f92c4e94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# Test Bytecount
#

$:.unshift "../../../build/swig/ruby"


# test loading of extension
require 'test/unit'

class LoadTest < Test::Unit::TestCase
  require 'zypp'

  def test_bytecount
    g = Zypp::ByteCount.new(Zypp::ByteCount.G)
    assert g
    gb = Zypp::ByteCount.new(Zypp::ByteCount.GB)
    assert gb
    k = Zypp::ByteCount.new(Zypp::ByteCount.K)
    assert k.to_i == 1024
    mb = Zypp::ByteCount.new(Zypp::ByteCount.MB)
    assert mb.to_i == 1000*1000
  end
end