spec/promise_spec.rb in celluloid-promise-1.0.0 vs spec/promise_spec.rb in celluloid-promise-1.0.1
- old
+ new
@@ -125,11 +125,11 @@
it "can modify the result of a promise before returning" do
@mutex.synchronize {
proc { |name|
- @defer.task! {
+ @defer.async.task {
@deferred.resolve("Hello #{name}")
}
@promise.then(proc {|result|
result.should == 'Hello Robin Hood'
result += "?"
@@ -260,13 +260,13 @@
Celluloid::Q.all(@promise, deferred1.promise, deferred2.promise).then(proc {|result|
result.should == [:foo, :bar, :baz]
@finish.call
}, @default_fail)
- @defer.task! { @deferred.resolve(:foo) }
- @defer.task! { deferred2.resolve(:baz) }
- @defer.task! { deferred1.resolve(:bar) }
+ @defer.async.task { @deferred.resolve(:foo) }
+ @defer.async.task { deferred2.resolve(:baz) }
+ @defer.async.task { deferred1.resolve(:bar) }
@resource.wait(@mutex)
}
end
@@ -279,11 +279,11 @@
Celluloid::Q.all(@promise, deferred1.promise, deferred2.promise).then(@default_fail, proc {|reason|
reason.should == :baz
@finish.call
})
- @defer.task! { @deferred.resolve(:foo) }
- @defer.task! { deferred2.reject(:baz) }
+ @defer.async.task { @deferred.resolve(:foo) }
+ @defer.async.task { deferred2.reject(:baz) }
@resource.wait(@mutex)
}
end