1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
13 class TestQtUtils < Test::Unit::TestCase
26 def test_painter_bracket
28 p.expects(:fill_rect).once
38 h = alphabet.detect_index {|l| "hello"[0, 1] == l }
42 result = alphabet.detect_index {|l| 0 == 1 }
46 def test_qvariant_from_to_ruby
47 hash = { :foo => ["bar", 4] }
48 var = Qt::Variant.from_ruby(hash)
49 assert_equal hash, var.to_ruby
51 assert_equal Foo, Qt::Variant.from_ruby(Foo).to_ruby
54 assert_equal foo, Qt::Variant.from_ruby(foo).to_ruby