throwing_pub.dart 1.16 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4 5 6
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

7
import 'package:flutter_tools/src/base/io.dart';
8
import 'package:flutter_tools/src/dart/pub.dart';
9
import 'package:meta/meta.dart';
10 11 12 13 14 15 16 17 18 19 20

class ThrowingPub implements Pub {
  @override
  Future<void> batch(List<String> arguments, {
    PubContext context,
    String directory,
    MessageFilter filter,
    String failureMessage = 'pub failed',
    bool retry,
    bool showTraceForErrors,
  }) {
21
    throw UnsupportedError('Attempted to invoke pub during test.');
22 23 24 25 26 27 28 29 30 31 32
  }

  @override
  Future<void> get({
    PubContext context,
    String directory,
    bool skipIfAbsent = false,
    bool upgrade = false,
    bool offline = false,
    bool checkLastModified = true,
    bool skipPubspecYamlCheck = false,
33
    String flutterRootOverride,
34
  }) {
35
    throw UnsupportedError('Attempted to invoke pub during test.');
36 37 38
  }

  @override
39
  Future<void> interactively(List<String> arguments, {String directory, @required Stdio stdio,}) {
40
    throw UnsupportedError('Attempted to invoke pub during test.');
41 42
  }
}