diff options
Diffstat (limited to 'test.rb')
-rwxr-xr-x | test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2,6 +2,7 @@ require 'test/unit' require 'mahoro' +require 'mahoro/thread_safe' require 'pathname' class MahoroTestCase < Test::Unit::TestCase @@ -90,6 +91,14 @@ class MahoroTestCase < Test::Unit::TestCase Mahoro.compile "magic.sample\0" end end + + def test_thread_safe + before = @m.method(:file) + @m.extend(Mahoro::ThreadSafe) + @m.flags = Mahoro::NONE + assert_c_text(@m.file('mahoro.c')) + assert_not_equal(before.object_id, @m.method(:file).object_id) + end end # arch-tag: test |