Permalink
Browse files

fix Mojo::Promise arguments

  • Loading branch information...
kraih committed Feb 13, 2018
1 parent c9e76b8 commit 45ad9fcc3fb77dcd51b4a3cdfbff8192f8e01f92
Showing with 4 additions and 3 deletions.
  1. +1 −1 lib/Mojo/Promise.pm
  2. +3 −2 t/mojo/promise.t
View
@@ -28,7 +28,7 @@ sub all {
);
}
- return @promises ? $all : $all->resolve([]);
+ return @promises ? $all : $all->resolve;
}
sub catch { shift->then(undef, shift) }
View
@@ -187,9 +187,10 @@ is_deeply \@errors, ['third'], 'promise rejected';
# Empty all
(@results, @errors) = ();
-Mojo::Promise->all()->then(sub { @results = @_ }, sub { @errors = @_ });
+Mojo::Promise->all()
+ ->then(sub { @results = 'pass', @_ }, sub { @errors = 'fail', @_ });
Mojo::IOLoop->one_tick;
-is_deeply \@results, [[]], 'promise resolved';
+is_deeply \@results, ['pass'], 'promise resolved';
is_deeply \@errors, [], 'promise not rejected';
# Settle with promise

0 comments on commit 45ad9fc

Please sign in to comment.