platform/test/all_tests.dart
regiostech 7259d2b73a 1.0.0
2016-05-02 19:35:21 -04:00

28 lines
No EOL
918 B
Dart

import 'package:angel_framework/angel_framework.dart';
import 'package:angel_configuration/angel_configuration.dart';
import 'package:test/test.dart';
main() async {
// Note: Set ANGEL_ENV to 'development'
Angel angel = new Angel();
await angel.configure(
loadConfigurationFile(directoryPath: './test/config'));
test('can load based on ANGEL_ENV', () async {
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"));
});
test('can override ANGEL_ENV', () async {
await angel.configure(loadConfigurationFile(
directoryPath: './test/config', overrideEnvironmentName: 'override'));
expect(angel.properties['hello'], equals('goodbye'));
expect(angel.properties['foo']['version'], equals('baz'));
});
}