put more code under test
diff --git a/lib/src/impl.dart b/lib/src/impl.dart
index 9a8c2a0..3a23de1 100644
--- a/lib/src/impl.dart
+++ b/lib/src/impl.dart
@@ -44,11 +44,13 @@
_resolver = resolver;
}
+ /// The git url.
+ String get url => _description['url'];
+
/// The git commit.
String get resolvedRef => _description['resolved-ref'];
- /// The git url.
- String get url => _description['url'];
+ String toString() => '${name} ${version} (${url}, ${resolvedRef})';
}
class PathPackageRefImpl extends PackageRefImpl {
@@ -66,6 +68,8 @@
Directory dir = new Directory(path);
return dir.existsSync() ? new Package(dir, name, version) : null;
}
+
+ String toString() => '${name} ${version} (${path}, relative=${relative})';
}
/// A reference to a package in the pub cache (for instance, something in
@@ -84,6 +88,8 @@
if (index != -1) {
_version = new Version.parse(_name.substring(index + 1));
_name = _name.substring(0, index);
+ } else {
+ _version = Version.none;
}
}
@@ -115,11 +121,8 @@
File f = new File(path.join(directory.path, 'pubspec.yaml'));
if (f.existsSync()) {
Map pubspec = yaml.loadYaml(f.readAsStringSync());
- if (pubspec['version'] == null) {
- _version = Version.none;
- } else {
- _version = new Version.parse(pubspec['version']);
- }
+ _version = pubspec.containsKey('version')
+ ? new Version.parse(pubspec['version']) : Version.none;
}
}
@@ -130,4 +133,6 @@
String get resolvedRef => _resolvedRef;
Package resolve() => new Package(directory, name, version);
+
+ String toString() => '${name} ${version} (${resolvedRef})';
}
diff --git a/tool/travis.sh b/tool/travis.sh
index dc1d87b..9cb7432 100755
--- a/tool/travis.sh
+++ b/tool/travis.sh
@@ -8,6 +8,7 @@
set -e
# Activate some packages for use while running tests.
+pub global activate dart_coveralls 0.1.10
pub global activate dart_coveralls
pub global activate --source git https://github.com/dart-lang/test.git
pub global activate --source path .