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

Unified Diff: test/client_test.dart

Issue 1311323002: Modernize the style. (Closed) Base URL: git@github.com:dart-lang/oauth2.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: test/client_test.dart
diff --git a/test/client_test.dart b/test/client_test.dart
index 7115095c0f7986bbfa6d192e9eecee5e61633147..969787a94e98905304ced8f9cac973fa7d6b1dd7 100644
--- a/test/client_test.dart
+++ b/test/client_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library client_test;
-
import 'dart:async';
import 'dart:convert';
@@ -17,16 +15,11 @@ final Uri requestUri = Uri.parse("http://example.com/resource");
final Uri tokenEndpoint = Uri.parse('http://example.com/token');
-ExpectClient httpClient;
-
-void createHttpClient() {
- httpClient = new ExpectClient();
-}
-
void main() {
- group('with expired credentials', () {
- setUp(createHttpClient);
+ var httpClient;
+ setUp(() => httpClient = new ExpectClient());
+ group('with expired credentials', () {
test("that can't be refreshed throws an ExpirationException on send", () {
var expiration = new DateTime.now().subtract(new Duration(hours: 1));
var credentials = new oauth2.Credentials(
@@ -70,8 +63,6 @@ void main() {
});
group('with valid credentials', () {
- setUp(createHttpClient);
-
test("sends a request with bearer authorization", () {
var credentials = new oauth2.Credentials('access token');
var client = new oauth2.Client('identifier', 'secret', credentials,
@@ -117,8 +108,6 @@ void main() {
});
group('with invalid credentials', () {
- setUp(createHttpClient);
-
test('throws an AuthorizationException for a 401 response', () {
var credentials = new oauth2.Credentials('access token');
var client = new oauth2.Client('identifier', 'secret', credentials,

Powered by Google App Engine
This is Rietveld 408576698