Sha256: ecf54e1b829a8ad14cf7ea416cb8366669d295d9eb6eef86b529c9461d4eb195

Contents?: true

Size: 689 Bytes

Versions: 6

Compression:

Stored size: 689 Bytes

Contents

require File.join(File.dirname(__FILE__),'api','api_helper')

# these specs are executed only with Async support
if not defined?(JRUBY_VERSION)
  describe "BasicEventMachineTest with Threads" do
    it_should_behave_like "ApiHelper" do 
      it "should run EventMachine gracefully and schedule callback execution in thread" do
        f = Fiber.current
        operation = proc { res = 1 }
        operation_res = 0
        callback = proc { |proc_res| operation_res = proc_res; f.resume }
        EventMachine.defer operation, callback
        Fiber.yield
        # this code should be executed only after the thread's return
        operation_res.should == 1
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rhoconnect-4.0.4 spec/async_spec.rb
rhoconnect-4.0.3 spec/async_spec.rb
rhoconnect-4.0.2 spec/async_spec.rb
rhoconnect-4.0.1 spec/async_spec.rb
rhoconnect-4.0.0 spec/async_spec.rb
rhoconnect-4.0.0.beta.24 spec/async_spec.rb