# frozen_string_literal: true

require 'spec_helper'

sumo_dir = os[:family] == 'windows' ? 'c:\sumo' : '/opt/SumoCollector'

describe file("#{sumo_dir}/config") do
  it { is_expected.to exist }
end

describe file("#{sumo_dir}/config/user.properties") do
  it { is_expected.to exist }
  its(:content) { is_expected.to match(/Generated by Chef/) }
  its(:content) { is_expected.to match(/name=test-instance/) }
  its(:content) { is_expected.to match(/hostName=example\.com/) }
  its(:content) { is_expected.to match(/description=A Test Kitchen instance/) }
  its(:content) { is_expected.to match(/category=Misc/) }
  its(:content) { is_expected.to match(/accessid=#{ENV['SUMO_ACCESS_ID']}/) }
  its(:content) { is_expected.to match(/accesskey=#{ENV['SUMO_ACCESS_KEY']}/) }
  its(:content) { is_expected.to match(/ephemeral=true/) }
  its(:content) { is_expected.to match(/proxyHost=proxy.test.com/) }
  its(:content) { is_expected.to match(/proxyPort=8080/) }
  its(:content) { is_expected.to match(/installerMode=true/) }
  its(:content) { is_expected.to match(%r{timeZone=Etc/UTC}) }
end
