Sha256: 8c24eb6c6df99731ad69e8e4b9fcd839b316b16cce148c40686206072bc40208

Contents?: true

Size: 683 Bytes

Versions: 10

Compression:

Stored size: 683 Bytes

Contents

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

# these specs are executed only with Async support
if RUBY_VERSION =~ /1.9/
  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

10 entries across 10 versions & 1 rubygems

Version Path
rhoconnect-3.3.1.beta4 spec/async_spec.rb
rhoconnect-3.3.1.beta3 spec/async_spec.rb
rhoconnect-3.3.1.beta2 spec/async_spec.rb
rhoconnect-3.2.1 spec/async_spec.rb
rhoconnect-3.2.0 spec/async_spec.rb
rhoconnect-3.2.0.beta5 spec/async_spec.rb
rhoconnect-3.2.0.beta4 spec/async_spec.rb
rhoconnect-3.2.0.beta3 spec/async_spec.rb
rhoconnect-3.2.0.beta2 spec/async_spec.rb
rhoconnect-3.2.0.beta1 spec/async_spec.rb