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

24 lines
763 B
PHP
Raw Normal View History

2016-08-05 15:10:28 +02:00
<?php
use function PMSIpilot\DockerComposeViz\fetchNetworks;
require_once __DIR__ . '/../vendor/autoload.php';
describe('Fetching networks', function() {
describe('from a version 1 configuration', function() {
it('should always return an empty array', function() {
$configuration = ['networks' => ['image' => 'bar']];
expect(fetchNetworks($configuration))->toBe([]);
});
});
describe('from a version 2 configuration', function() {
it('should fetch networks from the dedicated section', function() {
$configuration = ['version' => 2, 'networks' => ['foo' => [], 'bar' => []]];
expect(fetchNetworks($configuration))->toBe($configuration['networks']);
});
});
});