Merge pull request #4 from dart-lang/rename-to-defineReflectiveTests
Rename runReflectiveTests -> defineReflectiveTests.
diff --git a/.gitignore b/.gitignore
index 89f7747..65b96be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
.DS_Store
.idea
.pub/
+.project
.settings/
build/
packages
diff --git a/lib/test_reflective_loader.dart b/lib/test_reflective_loader.dart
index 6ea195a..f8387e3 100644
--- a/lib/test_reflective_loader.dart
+++ b/lib/test_reflective_loader.dart
@@ -11,7 +11,7 @@
import 'package:unittest/unittest.dart';
/**
- * Runs test methods existing in the given [type].
+ * Define tests using methods existing in the given [type].
*
* Methods with names starting with `test` are run using [test] function.
* Methods with names starting with `solo_test` are run using [solo_test] function.
@@ -26,13 +26,13 @@
* method invocation. If method returns [Future] to test some asyncronous
* behavior, then `tearDown` will be invoked in `Future.complete`.
*/
-void runReflectiveTests(Type type) {
+void defineReflectiveTests(Type type) {
ClassMirror classMirror = reflectClass(type);
if (!classMirror.metadata.any((InstanceMirror annotation) =>
- annotation.type.reflectedType == ReflectiveTest)) {
+ annotation.type.reflectedType == ReflectiveTest)) {
String name = MirrorSystem.getName(classMirror.qualifiedName);
throw new Exception('Class $name must have annotation "@reflectiveTest" '
- 'in order to be run by runReflectiveTests.');
+ 'in order to be run by runReflectiveTests.');
}
String className = MirrorSystem.getName(classMirror.simpleName);
group(className, () {
@@ -102,8 +102,8 @@
_runTest(ClassMirror classMirror, Symbol symbol) {
InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
return _invokeSymbolIfExists(instanceMirror, #setUp)
- .then((_) => instanceMirror.invoke(symbol, []).reflectee)
- .whenComplete(() => _invokeSymbolIfExists(instanceMirror, #tearDown));
+ .then((_) => instanceMirror.invoke(symbol, []).reflectee)
+ .whenComplete(() => _invokeSymbolIfExists(instanceMirror, #tearDown));
}
/**
diff --git a/pubspec.yaml b/pubspec.yaml
index d1c014e..60d4ec8 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: test_reflective_loader
-version: 0.0.2
+version: 0.0.3
description: Support for discovering tests and test suites using reflection.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/test_reflective_loader