Sha256: 2a8707b44b4c7b6ea80e2647ed1afe91ab7003c1ae4bace4491656afc6a14bfb

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')
require 'hammer_cli_foreman_openscap/scap_content'

describe HammerCLIForemanOpenscap::ScapContent do
  include CommandTestHelper

  context "ListCommand" do
    let(:cmd) { HammerCLIForemanOpenscap::ScapContent::ListCommand.new "", ctx }

    before :each do
      ComplianceResourceMock.scap_contents_list
    end

    context "parameters" do
      it_should_accept "no arguments"
      it_should_accept_search_params
    end

    context "output" do
      let(:expected_record_count) { cmd.resource.call(:index).length }
      it_should_print_n_records
      it_should_print_columns ["Id", "Title"]
    end
  end

  context "DeleteCommand" do
    let(:cmd) { HammerCLIForemanOpenscap::ScapContent::DeleteCommand.new("", ctx) }

    context "parameters" do
      it_should_accept "id", ["--id=1"]
    end
  end

  context "UpdateCommand" do
    let(:cmd) { HammerCLIForemanOpenscap::ScapContent::UpdateCommand.new("", ctx) }

    context "parameters" do
      it_should_accept "id", ["--id=1"]
    end
  end

  context "InfoCommand" do
    let(:cmd) { HammerCLIForemanOpenscap::ScapContent::InfoCommand.new("", ctx) }

    context "parameters" do
      it_should_accept "id", ["--id=1"]
    end

    context "output" do
      with_params ["--id=1"] do
        it_should_print_n_records 1
        it_should_print_columns ["Id", "Title", "Created at", "Original filename", "Scap content profiles", "Organizations"]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hammer_cli_foreman_openscap-0.1.4 test/unit/scap_content_test.rb
hammer_cli_foreman_openscap-0.1.3 test/unit/scap_content_test.rb