diff options
Diffstat (limited to 'swig/ruby/tests/bytecount.rb')
-rw-r--r-- | swig/ruby/tests/bytecount.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/swig/ruby/tests/bytecount.rb b/swig/ruby/tests/bytecount.rb new file mode 100644 index 0000000..5b46e14 --- /dev/null +++ b/swig/ruby/tests/bytecount.rb @@ -0,0 +1,25 @@ +# +# Test Bytecount +# + +$:.unshift "../../../build/swig/ruby" + + +# test loading of extension +require 'test/unit' + +class LoadTest < Test::Unit::TestCase + require 'zypp' + include Zypp + + def test_bytecount + g = ByteCount.new(ByteCount.G) + assert g + gb = ByteCount.new(ByteCount.GB) + assert gb + k = ByteCount.new(ByteCount.K) + assert k.to_i == 1024 + mb = ByteCount.new(ByteCount.MB) + assert mb.to_i == 1000*1000 + end +end |