Sha256: 9e9c20abec48af3f606f9a8c0bc57ef6fa6417ddffe23815e448066fc18082a7
Contents?: true
Size: 1.19 KB
Versions: 13
Compression:
Stored size: 1.19 KB
Contents
require File.dirname(__FILE__) + '/../../spec_helper' describe Spork::RunStrategy::Forking do before(:each) do @fake_framework = FakeFramework.new @run_strategy = Spork::RunStrategy::Forking.new(@fake_framework) end it "returns the result of the run_tests method from the forked child" do create_helper_file @fake_framework.stub!(:run_tests).and_return("tests were ran") @run_strategy.run("test", STDOUT, STDIN).should == "tests were ran" end it "aborts the current running thread when another run is started" do create_helper_file @fake_framework.wait_time = 0.25 first_run = Thread.new { @run_strategy.run("test", STDOUT, STDIN).should == nil } sleep(0.05) @run_strategy.run("test", STDOUT, STDIN).should == true # wait for the first to finish first_run.join end it "can abort the current run" do create_helper_file @fake_framework.wait_time = 5 started_at = Time.now first_run = Thread.new { @run_strategy.run("test", STDOUT, STDIN).should == true } sleep(0.05) @run_strategy.send(:abort) sleep(0.01) while @run_strategy.running? (Time.now - started_at).should < @fake_framework.wait_time end end unless windows?
Version data entries
13 entries across 13 versions & 3 rubygems