Sha256: c71259c1378a808deaae24415193fbfbb67a7bca36c00a74172a76ce18ce57e4

Contents?: true

Size: 1.63 KB

Versions: 31

Compression:

Stored size: 1.63 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')

require 'hammer_cli_foreman/config_report'

describe HammerCLIForeman::ConfigReport do

  include CommandTestHelper

  context "ListCommand" do
    before do
      ResourceMocks.mock_action_call(:config_reports, :index, [])
    end

    let(:cmd) { HammerCLIForeman::ConfigReport::ListCommand.new("", ctx) }

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

    context "output" do
      let(:expected_record_count) { count_records(cmd.resource.call(:index)) }

      it_should_print_n_records
      it_should_print_column "Id"
      it_should_print_column "Host"
      it_should_print_column "Last report"
      it_should_print_column "Applied"
      it_should_print_column "Restarted"
      it_should_print_column "Failed"
      it_should_print_column "Restart Failures"
      it_should_print_column "Skipped"
      it_should_print_column "Pending"
    end

  end


  context "InfoCommand" do

    let(:cmd) { HammerCLIForeman::ConfigReport::InfoCommand.new("", ctx) }

    context "parameters" do
      it_should_accept "id", ["--id=1"]
      # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
    end

  end


  context "DeleteCommand" do

    let(:cmd) { HammerCLIForeman::ConfigReport::DeleteCommand.new("", ctx) }

    context "parameters" do
      it_should_accept "id", ["--id=1"]
      # it_should_fail_with "no params", [] # TODO: temporarily disabled, parameters are checked in the id resolver
    end

  end


end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hammer_cli_foreman-2.3.2 test/unit/config_report_test.rb
hammer_cli_foreman-2.4.0 test/unit/config_report_test.rb
hammer_cli_foreman-2.3.1 test/unit/config_report_test.rb
hammer_cli_foreman-2.3.0 test/unit/config_report_test.rb
hammer_cli_foreman-2.1.3 test/unit/config_report_test.rb
hammer_cli_foreman-2.2.0 test/unit/config_report_test.rb
hammer_cli_foreman-2.1.2 test/unit/config_report_test.rb
hammer_cli_foreman-2.1.1 test/unit/config_report_test.rb
hammer_cli_foreman-2.1.0 test/unit/config_report_test.rb
hammer_cli_foreman-2.0.2 test/unit/config_report_test.rb
hammer_cli_foreman-2.0.1 test/unit/config_report_test.rb
hammer_cli_foreman-2.0.0 test/unit/config_report_test.rb
hammer_cli_foreman-0.19.7 test/unit/config_report_test.rb
hammer_cli_foreman-0.19.6 test/unit/config_report_test.rb
hammer_cli_foreman-0.19.5 test/unit/config_report_test.rb
hammer_cli_foreman-0.19.4 test/unit/config_report_test.rb
hammer_cli_foreman-0.19.3 test/unit/config_report_test.rb
hammer_cli_foreman-0.19.2 test/unit/config_report_test.rb
hammer_cli_foreman-0.18.2 test/unit/config_report_test.rb
hammer_cli_foreman-0.19.1 test/unit/config_report_test.rb