Sha256: 132b4ff3fff22094382d87451dd4f8d18094beb566b4b613f334a45bf5315fa3

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

require 'gir_ffi_test_helper'

describe GLib::MainLoop do
  describe "#run" do
    it "allows other threads to run" do
      main_loop = GLib::MainLoop.new nil, false

      a = []
      GLib.timeout_add(GLib::PRIORITY_DEFAULT, 100,
                       proc { main_loop.quit },
                       nil, nil)

      slow_thread = Thread.new do
        sleep 0.001
        a << "During run"
      end

      a << "Before run"
      main_loop.run
      a << "After run"

      slow_thread.join

      a.last.must_equal "After run"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gir_ffi-0.7.7 test/ffi-glib/main_loop_test.rb