Sha256: 3e32c997395cbe97c9bb801e41ba8c3b4f2542c3cbd040fffca0b355c2320de3

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

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

describe "RubyProcess" do
  it "should be able to do basic stuff" do
    Ruby_process::Cproxy.run do |data|
      sp = data[:subproc]
      sp.new(:String, "Wee")
      
      ts = []
      
      1.upto(50) do |tcount|
        ts << Thread.new do
          1.upto(250) do
            str = sp.new(:String, "Kasper Johansen")
            
            res1 = str.include?("Kasper")
            str << " More"
            
            res2 = str.include?("Johansen")
            str << " Even more"
            
            res3 = str.include?("Christina")
            str << " Much more"
            
            raise "Expected res1 to be true but it wasnt: '#{res1}'." if res1 != true
            raise "Expected res2 to be true but it wasnt: '#{res2}'." if res2 != true
            raise "Expected res3 to be false but it wasnt: '#{res3}'." if res3 != false
            
            print "."
          end
        end
      end
      
      ts.each do |t|
        t.join
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_process-0.0.7 spec/hard_load_spec.rb