Sha256: e8bf1f5077ed48642a5ef857b3a42fa830248e60a1dcba3592513fed49ab239d

Contents?: true

Size: 1.34 KB

Versions: 5

Compression:

Stored size: 1.34 KB

Contents

 require File.join(Gem.loaded_specs['hammer_cli_foreman'].full_gem_path, 'test/unit/apipie_resource_mock')

 module ComplianceResourceMock
  def self.arf
    {
      :id => 1,
      :host => {
        :name => "somewhere.example.com"
      },
      :reported_at => "1916-06-08",
      :passed => 24,
      :failed => 25,
      :othered => 26,
      :openscap_proxy_name => {
        :name => "scap_proxy.example.com"
      },
      :policy => {
        :name => "strict policy"
      }
    }
  end

  def self.policy
    {
      :id => 1,
      :name => "Very strict policy",
      :period => "monthly",
      :weekday => "",
      :cron_line => "0 * * * *",
      :scap_content_id => 5,
      :scap_content_profile_id => 5
    }
  end

  def self.scap_content
    {
      :id => 1,
      :title => "Red Hat fedora default content"
    }
  end

  def self.tailoring_file
    {
      :id => 1,
      :name => "Red Hat fedora tailored"
    }
  end


  def self.arf_reports_list
    ResourceMocks.mock_action_call(:arf_reports, :index, [arf])
  end

  def self.policies_list
    ResourceMocks.mock_action_call(:policies, :index, [policy])
  end

  def self.scap_contents_list
    ResourceMocks.mock_action_call(:scap_contents, :index, [scap_content])
  end

  def self.tailoring_files_list
    ResourceMocks.mock_action_call(:tailoring_files, :index, [tailoring_file])
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hammer_cli_foreman_openscap-0.1.13 test/compliance_resource_mock.rb
hammer_cli_foreman_openscap-0.1.12 test/compliance_resource_mock.rb
hammer_cli_foreman_openscap-0.1.11 test/compliance_resource_mock.rb
hammer_cli_foreman_openscap-0.1.10 test/compliance_resource_mock.rb
hammer_cli_foreman_openscap-0.1.9 test/compliance_resource_mock.rb