mongo_fixtures 0.0.3 copy "mongo_fixtures: ^0.0.3" to clipboard
mongo_fixtures: ^0.0.3 copied to clipboard

outdatedDart 1 only

Fixtures for MongoDb

MongoFixtures library for Dart #

Build Status

A library for inserting your test fixtures into the MongoDb using mongo_dart.

Usage #

A simple usage example:

import 'package:mongo_fixtures/mongo_fixtures.dart' as fixtures;

List<fixtures.Entity> fixturesProvider(fixtures.Loader loader) {
    return [

        new fixtures.Collection('some_collection')
            ..insert(map: {
                'field_one': 'value1',
                'field_two': 'value2',
                'field_three': loader.document('document').field('another_field_one'),
            }),

        new fixtures.Collection('some_another_collection')
            ..insert(map: {
                'another_field_one': 'value3',
                'another_field_two': 'value4',
            })
            ..insert(label: 'document', map: {
                'another_field_one': 'value3',
                'another_field_two': 'value4',
            })

    ];
}

main() {

    group('test group', () {

        setUp(() {
            return new fixtures.Loader('mongodb://127.0.0.1/db_for_test')
                .cleanAllAndInsert(fixturesProvider);
        });

        ...

    });
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
0
points
14
downloads

Publisher

unverified uploader

Weekly Downloads

Fixtures for MongoDb

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

mongo_dart

More

Packages that depend on mongo_fixtures