require 'yaml'

PROJECT_ROOT = File.join(File.dirname(__FILE__), '..', '..')
BROKER_SPEC_PATH = File.join(PROJECT_ROOT, 'jobs/cf-redis-broker/spec')
DEDICATED_NODE_SPEC_PATH = File.join(PROJECT_ROOT, 'jobs/dedicated-node/spec')

describe 'bosh specs' do
  describe 'broker' do
    subject { YAML.load_file(BROKER_SPEC_PATH) }

    it 'is configured expose redis.config_command as a bosh link' do
      expected_link = {
        'name' => 'redis_broker',
        'type' => 'redis_broker',
      }

      expect(subject['provides']).to include(expected_link)
    end
  end

  describe 'dedicated-node' do
    subject { YAML.load_file(DEDICATED_NODE_SPEC_PATH) }

    it 'is configured expose redis.config_command as a bosh link' do
      expected_link = {
        'name' => 'dedicated_node',
        'type' => 'redis',
      }

      expect(subject['provides']).to include(expected_link)
    end
  end
end

require 'yaml'

PROJECT_ROOT = File.join(File.dirname(__FILE__), '..', '..')
BROKER_SPEC_PATH = File.join(PROJECT_ROOT, 'jobs/cf-redis-broker/spec')
DEDICATED_NODE_SPEC_PATH = File.join(PROJECT_ROOT, 'jobs/dedicated-node/spec')

describe 'bosh specs' do
  describe 'broker' do
    subject { YAML.load_file(BROKER_SPEC_PATH) }

    it 'is configured expose redis.config_command as a bosh link' do
      expected_link = {
        'name' => 'redis_broker',
        'type' => 'redis_broker',
        'properties' => [
          'redis.broker.name',
          'redis.broker.nginx.port',
          'redis.broker.auth.username',
          'redis.broker.auth.password'
        ]
      }

      expect(subject['provides']).to include(expected_link)
    end
  end

  describe 'dedicated-node' do
    subject { YAML.load_file(DEDICATED_NODE_SPEC_PATH) }

    it 'is configured expose redis.config_command as a bosh link' do
      expected_link = {
        'name' => 'dedicated_node',
        'type' => 'redis',
      }

      expect(subject['provides']).to include(expected_link)
    end
  end
end

Update unit test for redis_broker link
Update unit test for redis_broker link

[#147827715]

Signed-off-by: Josh Hill <d8b194a1fc06171ecd965621d47d83f9b6bf4885@pivotal.io>
