@@ -36,19 +36,18 @@ test('gets S3 object', function(assert) {
3636 var data = { Body: new Buffer (' hello world' ) };
3737 var expected = { Bucket: ' bucket' , Key: ' key' };
3838
39- var getObject = AWS .stub (' S3' , ' getObject' , function (params , callback ) {
39+ AWS .stub (' S3' , ' getObject' , function (params , callback ) {
40+ assert .deepEqual (params, expected, ' called s3.getObject with expected params' );
4041 callback (null , data);
4142 });
4243
43- app (function (err , data ) {
44+ app . useCallback (function (err , data ) {
4445 assert .ifError (err, ' success' );
4546 assert .equal (data, ' hello world' );
4647
47- assert .equal (AWS .S3 .callCount , 1 , ' one s3 client created' );
48- assert .ok (AWS .S3 .calledWithExactly ({ region }), ' s3 client created for the correct region' );
49-
5048 assert .equal (getObject .callCount , 1 , ' called s3.getObject once' );
51- assert .ok (getObject .calledWith (expected), ' called s3.getObject with expected params' );
49+ assert .equal (AWS .S3 .callCount , 1 , ' one s3 client created' );
50+ assert .ok (AWS .S3 .calledWithExactly ({ region: ' eu-west-1' }), ' s3 client created for the correct region' );
5251
5352 AWS .S3 .restore ();
5453 assert .end ();
0 commit comments