docker-compose-viz/spec/fetch-services.php

24 lines
836 B
PHP
Raw Permalink Normal View History

2016-08-05 15:10:28 +02:00
<?php
use function PMSIpilot\DockerComposeViz\fetchServices;
2016-08-05 20:40:29 +02:00
require_once __DIR__.'/../vendor/autoload.php';
2016-08-05 15:10:28 +02:00
2016-08-05 20:40:29 +02:00
describe('Fetching services', function () {
describe('from a version 1 configuration', function () {
it('should fetch services from top-level keys', function () {
2016-08-05 15:10:28 +02:00
$configuration = ['foo' => ['image' => 'bar'], 'baz' => ['build' => '.']];
expect(fetchServices($configuration))->toBe($configuration);
});
});
2016-08-05 20:40:29 +02:00
describe('from a version 2 configuration', function () {
it('should fetch services from the dedicated section', function () {
2016-08-05 15:10:28 +02:00
$configuration = ['version' => 2, 'services' => ['foo' => ['image' => 'bar'], 'baz' => ['build' => '.']]];
expect(fetchServices($configuration))->toBe($configuration['services']);
});
});
});