engineyard-serverside 2.0.4 → 2.0.5.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/engineyard-serverside.rb +2 -1
- data/lib/engineyard-serverside/about.rb +37 -0
- data/lib/engineyard-serverside/cli.rb +2 -49
- data/lib/engineyard-serverside/configuration.rb +1 -0
- data/lib/engineyard-serverside/deploy.rb +5 -8
- data/lib/engineyard-serverside/propagator.rb +75 -0
- data/lib/engineyard-serverside/server.rb +3 -2
- data/lib/engineyard-serverside/servers.rb +28 -14
- data/lib/engineyard-serverside/shell.rb +6 -6
- data/lib/engineyard-serverside/shell/command_result.rb +1 -1
- data/lib/engineyard-serverside/strategies/git.rb +9 -4
- data/lib/engineyard-serverside/version.rb +1 -1
- data/spec/propagator_spec.rb +95 -0
- data/spec/spec_helper.rb +1 -1
- metadata +47 -68
- data/lib/engineyard-serverside/future.rb +0 -35
- data/lib/engineyard-serverside/futures/celluloid.rb +0 -15
- data/lib/engineyard-serverside/futures/dataflow.rb +0 -26
- data/lib/vendor/celluloid/lib/celluloid.rb +0 -261
- data/lib/vendor/celluloid/lib/celluloid/actor.rb +0 -242
- data/lib/vendor/celluloid/lib/celluloid/actor_pool.rb +0 -54
- data/lib/vendor/celluloid/lib/celluloid/actor_proxy.rb +0 -75
- data/lib/vendor/celluloid/lib/celluloid/application.rb +0 -78
- data/lib/vendor/celluloid/lib/celluloid/calls.rb +0 -93
- data/lib/vendor/celluloid/lib/celluloid/core_ext.rb +0 -14
- data/lib/vendor/celluloid/lib/celluloid/events.rb +0 -14
- data/lib/vendor/celluloid/lib/celluloid/fiber.rb +0 -33
- data/lib/vendor/celluloid/lib/celluloid/fsm.rb +0 -141
- data/lib/vendor/celluloid/lib/celluloid/future.rb +0 -60
- data/lib/vendor/celluloid/lib/celluloid/links.rb +0 -61
- data/lib/vendor/celluloid/lib/celluloid/logger.rb +0 -32
- data/lib/vendor/celluloid/lib/celluloid/mailbox.rb +0 -124
- data/lib/vendor/celluloid/lib/celluloid/receivers.rb +0 -66
- data/lib/vendor/celluloid/lib/celluloid/registry.rb +0 -33
- data/lib/vendor/celluloid/lib/celluloid/responses.rb +0 -26
- data/lib/vendor/celluloid/lib/celluloid/rspec.rb +0 -2
- data/lib/vendor/celluloid/lib/celluloid/signals.rb +0 -50
- data/lib/vendor/celluloid/lib/celluloid/supervisor.rb +0 -57
- data/lib/vendor/celluloid/lib/celluloid/task.rb +0 -73
- data/lib/vendor/celluloid/lib/celluloid/tcp_server.rb +0 -33
- data/lib/vendor/celluloid/lib/celluloid/timers.rb +0 -109
- data/lib/vendor/celluloid/lib/celluloid/version.rb +0 -4
- data/lib/vendor/dataflow/HISTORY +0 -52
- data/lib/vendor/dataflow/LICENSE +0 -19
- data/lib/vendor/dataflow/README.textile +0 -290
- data/lib/vendor/dataflow/Rakefile +0 -36
- data/lib/vendor/dataflow/dataflow.rb +0 -124
- data/lib/vendor/dataflow/dataflow/actor.rb +0 -22
- data/lib/vendor/dataflow/dataflow/equality.rb +0 -44
- data/lib/vendor/dataflow/dataflow/future_queue.rb +0 -24
- data/lib/vendor/dataflow/dataflow/port.rb +0 -54
- data/lib/vendor/dataflow/examples/barrier.rb +0 -9
- data/lib/vendor/dataflow/examples/data_driven.rb +0 -17
- data/lib/vendor/dataflow/examples/dataflow_http_gets.rb +0 -13
- data/lib/vendor/dataflow/examples/flow.rb +0 -20
- data/lib/vendor/dataflow/examples/future_http_gets.rb +0 -12
- data/lib/vendor/dataflow/examples/future_queue.rb +0 -11
- data/lib/vendor/dataflow/examples/instance_variables.rb +0 -15
- data/lib/vendor/dataflow/examples/laziness.rb +0 -9
- data/lib/vendor/dataflow/examples/local_variables.rb +0 -11
- data/lib/vendor/dataflow/examples/messages.rb +0 -26
- data/lib/vendor/dataflow/examples/port_http_gets.rb +0 -13
- data/lib/vendor/dataflow/examples/port_send.rb +0 -10
- data/lib/vendor/dataflow/examples/ring.rb +0 -21
- data/lib/vendor/dataflow/spec/actor_spec.rb +0 -28
- data/lib/vendor/dataflow/spec/anonymous_variables_spec.rb +0 -21
- data/lib/vendor/dataflow/spec/barrier_spec.rb +0 -25
- data/lib/vendor/dataflow/spec/by_need_spec.rb +0 -55
- data/lib/vendor/dataflow/spec/dataflow_spec.rb +0 -151
- data/lib/vendor/dataflow/spec/equality_spec.rb +0 -40
- data/lib/vendor/dataflow/spec/flow_spec.rb +0 -25
- data/lib/vendor/dataflow/spec/forker_spec.rb +0 -28
- data/lib/vendor/dataflow/spec/future_queue_spec.rb +0 -31
- data/lib/vendor/dataflow/spec/inspect_spec.rb +0 -19
- data/lib/vendor/dataflow/spec/need_later_spec.rb +0 -12
- data/lib/vendor/dataflow/spec/port_spec.rb +0 -26
- data/lib/vendor/dataflow/spec/spec.opts +0 -1
- data/lib/vendor/dataflow/spec/spec_helper.rb +0 -10
@@ -1,26 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
2
|
-
include Dataflow
|
3
|
-
|
4
|
-
Ping = Actor.new {
|
5
|
-
3.times {
|
6
|
-
case receive
|
7
|
-
when "Ping"
|
8
|
-
puts "Ping"
|
9
|
-
Pong.send "Pong"
|
10
|
-
end
|
11
|
-
}
|
12
|
-
}
|
13
|
-
|
14
|
-
Pong = Actor.new {
|
15
|
-
3.times {
|
16
|
-
case receive
|
17
|
-
when "Pong"
|
18
|
-
puts "Pong"
|
19
|
-
Ping.send "Ping"
|
20
|
-
end
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
Ping.send "Ping"
|
25
|
-
Ping.join
|
26
|
-
Pong.join
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
2
|
-
require 'net/http'
|
3
|
-
include Dataflow
|
4
|
-
|
5
|
-
# Be gentle running this one
|
6
|
-
Thread.abort_on_exception = true
|
7
|
-
local do |port, stream, branding_occurences, number_of_mentions|
|
8
|
-
unify port, Dataflow::Port.new(stream)
|
9
|
-
10.times { Thread.new(port) {|p| p.send Net::HTTP.get_response(URI.parse("http://www.cuil.com/search?q=#{rand(1000)}")).body } }
|
10
|
-
Thread.new { unify branding_occurences, stream.take(10).map {|http_body| http_body.scan /cuil/ } }
|
11
|
-
Thread.new { unify number_of_mentions, branding_occurences.map {|occurences| occurences.length } }
|
12
|
-
puts number_of_mentions.inspect
|
13
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
2
|
-
include Dataflow
|
3
|
-
|
4
|
-
local do |port, stream|
|
5
|
-
unify port, Dataflow::Port.new(stream)
|
6
|
-
Thread.new {port.send 2}
|
7
|
-
Thread.new {port.send 8}
|
8
|
-
Thread.new {port.send 1024}
|
9
|
-
puts stream.take(3).sort.inspect
|
10
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/../dataflow"
|
2
|
-
include Dataflow
|
3
|
-
|
4
|
-
# Send M messages each along a ring of N nodes
|
5
|
-
N = 4
|
6
|
-
M = 2
|
7
|
-
actors = Array.new(N) { Dataflow::Variable.new }
|
8
|
-
|
9
|
-
N.times do |n|
|
10
|
-
unify actors[n], Actor.new {
|
11
|
-
M.times do |m|
|
12
|
-
receive
|
13
|
-
puts "[#{n} #{m}]"
|
14
|
-
actors[(n+1) % N].send :msg
|
15
|
-
end
|
16
|
-
puts "[#{n}] done"
|
17
|
-
}
|
18
|
-
end
|
19
|
-
|
20
|
-
actors.first.send :msg
|
21
|
-
actors.each { |x| x.join }
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
describe 'Syncronously sending to an Actor' do
|
4
|
-
it 'passes in each message received and preserves order' do
|
5
|
-
local do |port, stream, actor|
|
6
|
-
unify port, Dataflow::Port.new(stream)
|
7
|
-
unify actor, Dataflow::Actor.new { 3.times { port.send receive } }
|
8
|
-
actor.send 1
|
9
|
-
actor.send 2
|
10
|
-
stream.take(2).should == [1, 2]
|
11
|
-
actor.send 3
|
12
|
-
stream.take(3).should == [1, 2, 3]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe 'Asyncronously sending to an Actor' do
|
18
|
-
it 'passes in each message received and preserves order' do
|
19
|
-
local do |port, stream, actor|
|
20
|
-
unify port, Dataflow::Port.new(stream)
|
21
|
-
unify actor, Dataflow::Actor.new { 3.times { port.send receive } }
|
22
|
-
Thread.new {actor.send 2}
|
23
|
-
Thread.new {actor.send 8}
|
24
|
-
Thread.new {actor.send 1024}
|
25
|
-
stream.take(3).sort.should == [2, 8, 1024]
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
describe 'Using an anonymous variable' do
|
4
|
-
it 'works with Variable instances' do
|
5
|
-
container = [Dataflow::Variable.new]
|
6
|
-
unify container.first, 1337
|
7
|
-
container.first.should == 1337
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'works with Dataflow.local' do
|
11
|
-
container = [Dataflow.local]
|
12
|
-
unify container.first, 1337
|
13
|
-
container.first.should == 1337
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'works with #local' do
|
17
|
-
container = [local]
|
18
|
-
unify container.first, 1337
|
19
|
-
container.first.should == 1337
|
20
|
-
end
|
21
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
describe 'A barrier' do
|
4
|
-
it 'waits for variables to be bound before continuing' do
|
5
|
-
local do |x, y, barrier_broken|
|
6
|
-
Thread.new do
|
7
|
-
barrier x, y
|
8
|
-
unify barrier_broken, true
|
9
|
-
end
|
10
|
-
Thread.new { unify x, :x }
|
11
|
-
Thread.new { unify y, :y }
|
12
|
-
barrier_broken.should be_true
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'continues for variables that are already bound' do
|
17
|
-
local do |x, y, barrier_broken|
|
18
|
-
unify x, :x
|
19
|
-
unify y, :y
|
20
|
-
barrier x, y
|
21
|
-
unify barrier_broken, true
|
22
|
-
barrier_broken.should be_true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
describe 'A by_need expression' do
|
4
|
-
describe 'when a method is called on it' do
|
5
|
-
it 'binds its variable' do
|
6
|
-
local do |x, y, z|
|
7
|
-
Thread.new { unify y, by_need { 4 } }
|
8
|
-
Thread.new { unify z, x + y }
|
9
|
-
Thread.new { unify x, by_need { 3 } }
|
10
|
-
z.should == 7
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe 'when a bound variable is unified to it' do
|
16
|
-
it 'passes unififcation for equal values' do
|
17
|
-
local do |x|
|
18
|
-
unify x, by_need { 1 }
|
19
|
-
unify x, 1
|
20
|
-
x.should == 1
|
21
|
-
|
22
|
-
y = by_need { 1 }
|
23
|
-
unify y, 1
|
24
|
-
y.should == 1
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'fails unififcation for unequal values' do
|
29
|
-
local do |x|
|
30
|
-
unify x, by_need { 1 }
|
31
|
-
lambda { unify x, 2 }.should raise_error(Dataflow::UnificationError)
|
32
|
-
|
33
|
-
y = by_need { 1 }
|
34
|
-
lambda { unify y, 2 }.should raise_error(Dataflow::UnificationError)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe 'when it is unified to a bound variable' do
|
39
|
-
it 'passes unififcation for equal values' do
|
40
|
-
local do |x|
|
41
|
-
unify x, 1
|
42
|
-
unify x, by_need { 1 }
|
43
|
-
x.should == 1
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'fails unification for unequal values' do
|
48
|
-
local do |x|
|
49
|
-
unify x, 1
|
50
|
-
lambda { unify x, by_need { 2 } }.should raise_error(Dataflow::UnificationError)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,151 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
context 'Using "local" for local variables' do
|
4
|
-
describe 'An unbound Variable' do
|
5
|
-
it 'suspends if an unbound variable has a method called on it until it is bound' do
|
6
|
-
local do |big_cat, small_cat|
|
7
|
-
Thread.new { unify big_cat, small_cat.upcase }
|
8
|
-
unify small_cat, 'cat'
|
9
|
-
big_cat.should == 'CAT'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'suspends if an unbound variable has a method called on it until it is bound with nil' do
|
14
|
-
local do |is_nil, var_nil|
|
15
|
-
Thread.new { unify is_nil, var_nil.nil? }
|
16
|
-
unify var_nil, nil
|
17
|
-
is_nil.should be_true
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'suspends if an unbound variable has a method called on it until it is bound (with nested local variables)' do
|
22
|
-
local do |small_cat|
|
23
|
-
local do |big_cat|
|
24
|
-
Thread.new { unify big_cat, small_cat.upcase }
|
25
|
-
unify small_cat, 'cat'
|
26
|
-
big_cat.should == 'CAT'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'performs order-determining concurrency' do
|
32
|
-
local do |x, y, z|
|
33
|
-
Thread.new { unify y, x + 2 }
|
34
|
-
Thread.new { unify z, y + 3 }
|
35
|
-
Thread.new { unify x, 1 }
|
36
|
-
z.should == 6
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'binds on unification' do
|
41
|
-
local do |animal|
|
42
|
-
unify animal, 'cat'
|
43
|
-
animal.should == 'cat'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe 'A bound Variable' do
|
50
|
-
it 'does not complain when unifying with an equal object' do
|
51
|
-
lambda do
|
52
|
-
local do |animal|
|
53
|
-
unify animal, 'cat'
|
54
|
-
unify animal, 'cat'
|
55
|
-
end
|
56
|
-
end.should_not raise_error
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'does not complain when unifying with an unequal object when shadowing' do
|
60
|
-
lambda do
|
61
|
-
local do |animal|
|
62
|
-
unify animal, 'cat'
|
63
|
-
local do |animal|
|
64
|
-
unify animal, 'dog'
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end.should_not raise_error
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'complains when unifying with an unequal object' do
|
71
|
-
lambda do
|
72
|
-
local do |animal|
|
73
|
-
unify animal, 'cat'
|
74
|
-
unify animal, 'dog'
|
75
|
-
end
|
76
|
-
end.should raise_error(Dataflow::UnificationError)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
context 'Using "declare" for object-specific read-only attributes' do
|
81
|
-
class Store
|
82
|
-
include Dataflow
|
83
|
-
declare :animal, :big_cat, :small_cat, :x, :y, :z, :is_nil, :var_nil
|
84
|
-
end
|
85
|
-
before { @store = Store.new }
|
86
|
-
|
87
|
-
describe 'An unbound Variable' do
|
88
|
-
it 'suspends if an unbound variable has a method called on it until it is bound' do
|
89
|
-
Thread.new { unify @store.big_cat, @store.small_cat.upcase }
|
90
|
-
unify @store.small_cat, 'cat'
|
91
|
-
@store.big_cat.should == 'CAT'
|
92
|
-
end
|
93
|
-
|
94
|
-
it 'suspends if an unbound variable has a method called on it until it is bound with nil' do
|
95
|
-
Thread.new { unify @store.is_nil, @store.var_nil.nil? }
|
96
|
-
unify @store.var_nil, nil
|
97
|
-
@store.is_nil.should be_true
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'performs order-determining concurrency' do
|
101
|
-
Thread.new { unify @store.y, @store.x + 2 }
|
102
|
-
Thread.new { unify @store.z, @store.y + 3 }
|
103
|
-
Thread.new { unify @store.x, 1 }
|
104
|
-
@store.z.should == 6
|
105
|
-
end
|
106
|
-
|
107
|
-
it 'binds on unification' do
|
108
|
-
unify @store.animal, 'cat'
|
109
|
-
@store.animal.should == 'cat'
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
describe 'A bound Variable' do
|
114
|
-
it 'does not complain when unifying with an equal object' do
|
115
|
-
lambda do
|
116
|
-
unify @store.animal, 'cat'
|
117
|
-
unify @store.animal, 'cat'
|
118
|
-
end.should_not raise_error
|
119
|
-
end
|
120
|
-
|
121
|
-
it 'complains when unifying with an unequal object' do
|
122
|
-
lambda do
|
123
|
-
unify @store.animal, 'cat'
|
124
|
-
unify @store.animal, 'dog'
|
125
|
-
end.should raise_error(Dataflow::UnificationError)
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
describe 'Binding a variable that proxies through another' do
|
131
|
-
it 'binds through successfully' do
|
132
|
-
local do |x, y|
|
133
|
-
lambda do
|
134
|
-
unify x, y
|
135
|
-
unify x, 1337
|
136
|
-
x.should == 1337
|
137
|
-
y.should == 1337
|
138
|
-
end.should_not raise_error
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
describe 'Using static/module method' do
|
144
|
-
it 'works like the mixin versions' do
|
145
|
-
Dataflow.local do |big_cat, small_cat|
|
146
|
-
Thread.new { Dataflow.unify big_cat, small_cat.upcase }
|
147
|
-
Dataflow.unify small_cat, 'cat'
|
148
|
-
big_cat.should == 'CAT'
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
describe 'Unifying a bound value' do
|
4
|
-
[nil, true, false,
|
5
|
-
:sym, "str", /regex/,
|
6
|
-
3, 2.0,
|
7
|
-
Object.new, Class.new.new,
|
8
|
-
[], {}].each do |type|
|
9
|
-
describe "for #{type.class} instances" do
|
10
|
-
it 'passes unification for an object of equal value' do
|
11
|
-
local do |var, var2|
|
12
|
-
unify var, type
|
13
|
-
var.should == type
|
14
|
-
type.should == var
|
15
|
-
lambda {unify var, type}.should_not raise_error
|
16
|
-
|
17
|
-
unify var2, type
|
18
|
-
var.should == var2
|
19
|
-
var2.should == var
|
20
|
-
lambda {unify var, var2}.should_not raise_error
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'fails unification for an object of inequal value' do
|
25
|
-
different = Object.new
|
26
|
-
local do |var, var2|
|
27
|
-
unify var, type
|
28
|
-
var.should_not == different
|
29
|
-
different.should_not == var
|
30
|
-
lambda {unify var, different}.should raise_error(Dataflow::UnificationError)
|
31
|
-
|
32
|
-
unify var2, different
|
33
|
-
var.should_not == var2
|
34
|
-
var2.should_not == var
|
35
|
-
lambda {unify var, different}.should raise_error(Dataflow::UnificationError)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
describe 'Using flow without a parameter' do
|
4
|
-
it 'works like normal threads' do
|
5
|
-
local do |big_cat, small_cat|
|
6
|
-
flow { unify big_cat, small_cat.upcase }
|
7
|
-
unify small_cat, 'cat'
|
8
|
-
big_cat.should == 'CAT'
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe 'Using flow with a parameter' do
|
14
|
-
it 'binds the parameter to the last line of the block' do
|
15
|
-
local do |big_cat, small_cat, output|
|
16
|
-
flow(output) do
|
17
|
-
unify big_cat, small_cat.upcase
|
18
|
-
'returned'
|
19
|
-
end
|
20
|
-
unify small_cat, 'cat'
|
21
|
-
big_cat.should == 'CAT'
|
22
|
-
output.should == 'returned'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require "#{File.dirname(__FILE__)}/spec_helper"
|
2
|
-
|
3
|
-
describe 'Setting a customer forker' do
|
4
|
-
before(:all) do
|
5
|
-
@original_forker = Dataflow.forker
|
6
|
-
Dataflow.forker = Class.new do
|
7
|
-
def self.synchronous_forker(&block)
|
8
|
-
block.call
|
9
|
-
end
|
10
|
-
end.method(:synchronous_forker)
|
11
|
-
end
|
12
|
-
|
13
|
-
after(:all) do
|
14
|
-
Dataflow.forker = @original_forker
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'uses the custom forker in #flow' do
|
18
|
-
local do |my_var|
|
19
|
-
flow(my_var) { 1337 }
|
20
|
-
my_var.should == 1337
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'uses the custom forker in #need_later' do
|
25
|
-
my_var = need_later { 1337 }
|
26
|
-
my_var.should == 1337
|
27
|
-
end
|
28
|
-
end
|