Sha256: 5a780634c0945ccc0e88954cf703d89c17c5aa553b3249e9640a11d95d1c9a8d

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "RubyProcess" do
  it "should be able to clean up after itself when timeout" do
    require "timeout"
    
    Ruby_process::Cproxy.run do |data|
      sp = data[:subproc]
      
      begin
        Timeout.timeout(1) do
          sp.static(:Object, :sleep, 2)
        end
        
        raise "Expected timeout to be raised."
      rescue Timeout::Error
        #ignore.
      end
      
      answers = sp.instance_variable_get(:@answers)
      raise "'answers'-variable should be empty but wasnt: '#{answers}'." if !answers.empty?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby_process-0.0.9 spec/leaks_spec.rb
ruby_process-0.0.8 spec/leaks_spec.rb