platform/test/all_tests.dart

28 lines
918 B
Dart
Raw Normal View History

2016-04-22 01:17:31 +00:00
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_configuration/angel_configuration.dart';
import 'package:test/test.dart';
2016-05-02 23:35:21 +00:00
main() async {
2016-04-22 01:17:31 +00:00
// Note: Set ANGEL_ENV to 'development'
Angel angel = new Angel();
2016-05-02 23:35:21 +00:00
await angel.configure(
loadConfigurationFile(directoryPath: './test/config'));
2016-04-22 01:17:31 +00:00
2016-05-02 23:35:21 +00:00
test('can load based on ANGEL_ENV', () async {
2016-04-22 01:17:31 +00:00
expect(angel.properties['hello'], equals('world'));
expect(angel.properties['foo']['version'], equals('bar'));
});
test('will load default.yaml if exists', () {
expect(angel.properties["set_via"], equals("default"));
});
2016-05-02 23:35:21 +00:00
test('can override ANGEL_ENV', () async {
await angel.configure(loadConfigurationFile(
2016-04-22 01:17:31 +00:00
directoryPath: './test/config', overrideEnvironmentName: 'override'));
expect(angel.properties['hello'], equals('goodbye'));
expect(angel.properties['foo']['version'], equals('baz'));
});
}