From 30c04d6ba0a2748288b43c3259b976d0fe9f00d0 Mon Sep 17 00:00:00 2001 From: thosakwe Date: Sat, 10 Dec 2016 12:05:31 -0500 Subject: [PATCH] Need to work on custom matchers --- .gitignore | 45 +++++++++++++++++++++++++++++++++++++ .idea/angel_test.iml | 18 +++++++++++++++ .idea/jsLibraryMappings.xml | 7 ++++++ .idea/misc.xml | 28 +++++++++++++++++++++++ .idea/modules.xml | 8 +++++++ .idea/vcs.xml | 6 +++++ lib/angel_test.dart | 1 + lib/src/client.dart | 23 +++++++++++++++++++ lib/src/matchers.dart | 0 pubspec.yaml | 14 ++++++++++++ test/simple_test.dart | 8 +++++++ 11 files changed, 158 insertions(+) create mode 100644 .idea/angel_test.iml create mode 100644 .idea/jsLibraryMappings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 lib/angel_test.dart create mode 100644 lib/src/client.dart create mode 100644 lib/src/matchers.dart create mode 100644 pubspec.yaml create mode 100644 test/simple_test.dart diff --git a/.gitignore b/.gitignore index 7c280441..31ed0d01 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ .packages .project .pub/ +.scripts-bin/ build/ **/packages/ @@ -25,3 +26,47 @@ doc/api/ # Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml + +# Sensitive or high-churn files: +.idea/dataSources/ +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + diff --git a/.idea/angel_test.iml b/.idea/angel_test.iml new file mode 100644 index 00000000..a928d34a --- /dev/null +++ b/.idea/angel_test.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 00000000..f3e502d1 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..c65900a0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + General + + + XPath + + + + + AngularJS + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..ec4e4911 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/lib/angel_test.dart b/lib/angel_test.dart new file mode 100644 index 00000000..8084f4d5 --- /dev/null +++ b/lib/angel_test.dart @@ -0,0 +1 @@ +export 'src/client.dart'; \ No newline at end of file diff --git a/lib/src/client.dart b/lib/src/client.dart new file mode 100644 index 00000000..5dfa49ba --- /dev/null +++ b/lib/src/client.dart @@ -0,0 +1,23 @@ +import 'dart:async'; +import 'dart:io'; +import 'package:angel_client/io.dart' as client; +import 'package:angel_framework/angel_framework.dart' as server; + +Future connectTo(server.Angel app) async { + final server = await app.startServer(); + return new _TestClient( + server, 'http://${server.address.address}:${server.port}'); +} + +class _TestClient extends client.Rest { + final HttpServer server; + + _TestClient(this.server, String path) : super(path); + + @override + Future close() async { + if (server != null) { + await server.close(force: true); + } + } +} diff --git a/lib/src/matchers.dart b/lib/src/matchers.dart new file mode 100644 index 00000000..e69de29b diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 00000000..ae8e556d --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,14 @@ +author: "Tobe O " +description: "Testing utility library for the Angel framework." +homepage: "https://github.com/angel-dart/test.git" +name: "angel_test" +version: "1.0.0-dev" +dependencies: + angel_client: "^1.0.0-dev+16" + angel_framework: "^1.0.0-dev" + http: "^0.11.3+9" + matcher: "^0.12.0+2" +dev_dependencies: + test: "^0.12.17+2" +environment: + sdk: ">=1.19.0" diff --git a/test/simple_test.dart b/test/simple_test.dart new file mode 100644 index 00000000..8fc36d0c --- /dev/null +++ b/test/simple_test.dart @@ -0,0 +1,8 @@ +import 'package:angel_framework/angel_framework.dart'; +import 'package:angel_test/angel_test.dart'; +import 'package:test/test.dart'; + +main() { + Angel app; + +} \ No newline at end of file