spork 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,10 @@ module Spork
33
33
  @state = :using_spork
34
34
  end
35
35
 
36
+ def using_spork?
37
+ @state == :using_spork
38
+ end
39
+
36
40
  # Used by the server. Returns the current state of Spork.
37
41
  def state
38
42
  @state ||= :not_using_spork
@@ -20,6 +20,7 @@ class Spork::RunStrategy::Forking < Spork::RunStrategy
20
20
  end
21
21
 
22
22
  def preload
23
+ require test_framework.entry_point
23
24
  test_framework.preload
24
25
  end
25
26
 
@@ -25,7 +25,8 @@ class Spork::Server
25
25
  trap("SIGINT") { sig_int_received }
26
26
  trap("SIGTERM") { abort; exit!(0) }
27
27
  trap("USR2") { abort; restart } if Signal.list.has_key?("USR2")
28
- DRb.start_service("druby://127.0.0.1:#{port}", self)
28
+ @drb_service = DRb.start_service("druby://127.0.0.1:#{port}", self)
29
+ Spork.each_run { @drb_service.stop_service }
29
30
  stderr.puts "Spork is ready and listening on #{port}!"
30
31
  stderr.flush
31
32
  DRb.thread.join
@@ -60,6 +60,14 @@ describe Spork do
60
60
  Spork.send(:expanded_caller, "/boo/../yah.rb:31").should == "/yah.rb:31"
61
61
  end
62
62
 
63
+ describe "#using_spork?" do
64
+ it "returns true if Spork is being used" do
65
+ Spork.using_spork?.should be_false
66
+ Spork.using_spork!
67
+ Spork.using_spork?.should be_true
68
+ end
69
+ end
70
+
63
71
  describe "#trap_method" do
64
72
  before(:each) do
65
73
  Spork.using_spork!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Harper
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-14 00:00:00 -04:00
12
+ date: 2009-09-17 00:00:00 -04:00
13
13
  default_executable: spork
14
14
  dependencies: []
15
15