Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: dart/sdk/lib/_internal/pub/test/hosted/version_negotiation_test.dart

Issue 15793010: Version 0.5.14.1 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/sdk/bin/dart2analyzer_developer ('k') | dart/tests/standalone/coverage_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library pub_tests;
6
7 import 'dart:io';
8
9 import 'package:scheduled_test/scheduled_server.dart';
10 import 'package:scheduled_test/scheduled_test.dart';
11
12 import '../descriptor.dart' as d;
13 import '../test_pub.dart';
14
15 main() {
16 initConfig();
17
18 forBothPubInstallAndUpdate((command) {
19 integration('sends the correct Accept header', () {
20 var server = new ScheduledServer();
21
22 d.appDir([{
23 "hosted": {
24 "name": "foo",
25 "url": server.url.then((url) => url.toString())
26 }
27 }]).create();
28
29 var pub = startPub(args: [command.name]);
30
31 server.handle('GET', '/api/packages/foo', (request) {
32 expect(request.headers['Accept'], ['application/vnd.pub.v2+json']);
33 });
34
35 pub.kill();
36 });
37
38 integration('prints a friendly error if the version is out-of-date', () {
39 var server = new ScheduledServer();
40
41 d.appDir([{
42 "hosted": {
43 "name": "foo",
44 "url": server.url.then((url) => url.toString())
45 }
46 }]).create();
47
48 var pub = startPub(args: [command.name]);
49
50 server.handle('GET', '/api/packages/foo', (request) {
51 request.response.statusCode = 406;
52 request.response.close();
53 });
54
55 // TODO(nweiz): this shouldn't request the versions twice (issue 11077).
56 server.handle('GET', '/api/packages/foo', (request) {
57 request.response.statusCode = 406;
58 request.response.close();
59 });
60
61 pub.shouldExit(1);
62
63 expect(pub.remainingStderr(), completion(equals(
64 "Pub 0.1.2+3 is incompatible with the current version of localhost.\n"
65 "Upgrade pub to the latest version and try again.")));
66 });
67 });
68 }
OLDNEW
« no previous file with comments | « dart/sdk/bin/dart2analyzer_developer ('k') | dart/tests/standalone/coverage_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698