Skip to content
Snippets Groups Projects
Commit 05ef530a authored by rnystrom@google.com's avatar rnystrom@google.com
Browse files

Make integration tests a bit cleaner.

Review URL: https://codereview.chromium.org//11943005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@17300 260f80e4-7a28-3924-810f-c04153c831b5
parent 894cc65a
No related branches found
No related tags found
No related merge requests found
Showing
with 25 additions and 80 deletions
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out and updates a package from Git', () {
integration('checks out and updates a package from Git', () {
ensureGit();
git('foo.git', [
......@@ -63,7 +62,5 @@ main() {
file('foo.dart', 'main() => "foo 2";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out a package at a specific branch from Git', () {
integration('checks out a package at a specific branch from Git', () {
ensureGit();
var repo = git('foo.git', [
......@@ -35,7 +34,5 @@ main() {
file('foo.dart', 'main() => "foo 1";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out a package at a specific revision from Git', () {
integration('checks out a package at a specific revision from Git', () {
ensureGit();
var repo = git('foo.git', [
......@@ -35,7 +34,5 @@ main() {
file('foo.dart', 'main() => "foo 1";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out a package from Git', () {
integration('checks out a package from Git', () {
ensureGit();
git('foo.git', [
......@@ -35,7 +34,5 @@ main() {
file('foo.dart', 'main() => "foo";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out packages transitively from Git', () {
integration('checks out packages transitively from Git', () {
ensureGit();
git('foo.git', [
......@@ -47,7 +46,5 @@ main() {
file('bar.dart', 'main() => "bar";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out a package from Git twice', () {
integration('checks out a package from Git twice', () {
ensureGit();
git('foo.git', [
......@@ -43,7 +42,5 @@ main() {
// in the cache.
schedulePub(args: ['install'],
output: new RegExp(r"Dependencies installed!$"));
run();
});
}
......@@ -6,12 +6,12 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
import '../../test_pub.dart';
main() {
group("(regression)", () {
test('checks out a package from Git with a trailing slash', () {
integration('checks out a package from Git with a trailing slash', () {
ensureGit();
git('foo.git', [
......@@ -36,8 +36,6 @@ main() {
file('foo.dart', 'main() => "foo";')
])
]).scheduleValidate();
run();
});
});
}
......@@ -7,10 +7,10 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('requires the dependency name to match the remote pubspec name', () {
integration('requires the dependency name to match the remote pubspec '
'name', () {
ensureGit();
git('foo.git', [
......@@ -34,7 +34,5 @@ main() {
'"weirdname", doesn\'t match the name "foo" in its '
r'pubspec\.'),
exitCode: 1);
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('doesn\'t require the repository name to match the name in the '
integration('doesn\'t require the repository name to match the name in the '
'pubspec', () {
ensureGit();
......@@ -36,7 +35,5 @@ main() {
file('weirdname.dart', 'main() => "weirdname";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('keeps a Git package locked to the version in the lockfile', () {
integration('keeps a Git package locked to the version in the lockfile', () {
ensureGit();
git('foo.git', [
......@@ -47,7 +46,5 @@ main() {
file('foo.dart', 'main() => "foo";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,10 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('requires the dependency to have a pubspec with a name field', () {
integration('requires the dependency to have a pubspec with a name '
'field', () {
ensureGit();
git('foo.git', [
......@@ -26,7 +26,5 @@ main() {
error: new RegExp(r'^Package "foo"' "'" 's pubspec.yaml file is '
r'missing the required "name" field \(e\.g\. "name: foo"\)\.'),
exitCode: 1);
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('requires the dependency to have a pubspec', () {
integration('requires the dependency to have a pubspec', () {
ensureGit();
git('foo.git', [
......@@ -25,7 +24,5 @@ main() {
error: new RegExp('^Package "foo" doesn\'t have a '
'pubspec.yaml file.'),
exitCode: 1);
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test("doesn't update a locked Git package with a new compatible "
integration("doesn't update a locked Git package with a new compatible "
"constraint", () {
ensureGit();
......@@ -45,7 +44,5 @@ main() {
file('foo.dart', 'main() => "foo 1.0.0";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,10 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('updates a locked Git package with a new incompatible constraint', () {
integration('updates a locked Git package with a new incompatible '
'constraint', () {
ensureGit();
git('foo.git', [
......@@ -44,7 +44,5 @@ main() {
file('foo.dart', 'main() => "foo 1.0.0";')
])
]).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out a package from a pub server', () {
integration('checks out a package from a pub server', () {
servePackages([package("foo", "1.2.3")]);
appDir([dependency("foo", "1.2.3")]).scheduleCreate();
......@@ -20,7 +19,5 @@ main() {
cacheDir({"foo": "1.2.3"}).scheduleValidate();
packagesDir({"foo": "1.2.3"}).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('checks out packages transitively from a pub server', () {
integration('checks out packages transitively from a pub server', () {
servePackages([
package("foo", "1.2.3", [dependency("bar", "2.0.4")]),
package("bar", "2.0.3"),
......@@ -25,7 +24,5 @@ main() {
cacheDir({"foo": "1.2.3", "bar": "2.0.4"}).scheduleValidate();
packagesDir({"foo": "1.2.3", "bar": "2.0.4"}).scheduleValidate();
run();
});
}
......@@ -7,10 +7,10 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test("doesn't update dependencies whose constraints have been removed", () {
integration("doesn't update dependencies whose constraints have been "
"removed", () {
servePackages([
package("foo", "1.0.0", [dependency("shared-dep")]),
package("bar", "1.0.0", [dependency("shared-dep", "<2.0.0")]),
......@@ -39,7 +39,5 @@ main() {
"bar": null,
"shared-dep": "1.0.0"
}).scheduleValidate();
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('fails gracefully if the package does not exist', () {
integration('fails gracefully if the package does not exist', () {
servePackages([]);
appDir([dependency("foo", "1.2.3")]).scheduleCreate();
......@@ -19,7 +18,5 @@ main() {
error: new RegExp('Could not find package "foo" at '
'http://localhost:'),
exitCode: 1);
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test('fails gracefully if the url does not resolve', () {
integration('fails gracefully if the url does not resolve', () {
dir(appPath, [
pubspec({
"name": "myapp",
......@@ -28,7 +27,5 @@ main() {
schedulePub(args: ['install'],
error: new RegExp('Could not resolve URL "http://pub.invalid".'),
exitCode: 1);
run();
});
}
......@@ -7,10 +7,9 @@ library pub_tests;
import 'dart:io';
import '../../test_pub.dart';
import '../../../../../pkg/unittest/lib/unittest.dart';
main() {
test("removes a dependency that's been removed from the pubspec", () {
integration("removes a dependency that's been removed from the pubspec", () {
servePackages([
package("foo", "1.0.0"),
package("bar", "1.0.0")
......@@ -35,7 +34,5 @@ main() {
"foo": "1.0.0",
"bar": null
}).scheduleValidate();
run();
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment