Sha256: aff061fbb8445eb27401b2044b11e964574ef9a8ae2a4784d847a363616b818b

Contents?: true

Size: 1.48 KB

Versions: 14

Compression:

Stored size: 1.48 KB

Contents

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

describe HammerCLIForemanOpenscap::TailoringFile do
  include CommandTestHelper

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

    before :each do
      ComplianceResourceMock.tailoring_files_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", "Name"]
    end
  end

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

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

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

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

  context "InfoCommand" do
    let(:cmd) { HammerCLIForemanOpenscap::TailoringFile::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", "Name", "Created at", "Original filename", "Tailoring file profiles", "Organizations"]
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hammer_cli_foreman_openscap-0.2.2 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.2.1 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.2.0 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.13 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.12 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.11 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.10 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.9 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.8 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.7 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.6 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.5 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.4 test/unit/tailoring_file_test.rb
hammer_cli_foreman_openscap-0.1.3 test/unit/tailoring_file_test.rb