You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: metrics_capture_spec.rb
    path of file: ./repos/manageiq/spec/models/manageiq/providers/cloud_manager
    
    the code of the file until where you have to start completion: RSpec.describe ManageIQ::Providers::CloudManager::MetricsCapture do
  include Spec::Support::MetricHelper

  let(:miq_server) { EvmSpecHelper.local_miq_server }
  let(:ems)  { FactoryBot.create(:ems_open
    
  def assert_cloud_targets_enabled(targets)
    targets.each do |t|
      expected_enabled = case t
                         # Vm's perf_capture_enabled? is its availability_zone's perf_capture setting,
                         #   or true if it has no availability_zone
                         when Vm then                t.availability_zone ? t.availability_zone.perf_capture_enabled? : true
                         when AvailabilityZone then  t.perf_capture_enabled?
                         when Storage then           t.perf_capture_enabled?
                         end
      expect(expected_enabled).to be_truthy
    end