test/test_helper.rb in gir_ffi-gtk-0.12.1 vs test/test_helper.rb in gir_ffi-gtk-0.13.0
- old
+ new
@@ -1,15 +1,14 @@
-if RUBY_PLATFORM == 'java'
- require 'rubygems'
-end
+require 'rubygems' if RUBY_PLATFORM == 'java'
begin
require 'simplecov'
SimpleCov.start do
- add_filter "/test/"
+ add_filter '/test/'
end
rescue LoadError
+ nil # SimpleCov not available
end
require 'minitest/autorun'
require 'rr'
@@ -19,17 +18,19 @@
require 'gir_ffi-gtk2'
else
require 'gir_ffi-gtk3'
end
-class Minitest::Test
+module BaseTestExtensions
def assert_nothing_raised
yield
assert true
end
- def ref_count object
+ def ref_count(object)
GObject::Object::Struct.new(object.to_ptr)[:ref_count]
end
end
+
+Minitest::Test.send :include, BaseTestExtensions
Gtk.init