Sha256: 96ba4907807fb99755a7400d3dda3f2c019d04e04ee40be232f270166c567261

Contents?: true

Size: 1.67 KB

Versions: 12

Compression:

Stored size: 1.67 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 "Origin"
      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

12 entries across 12 versions & 1 rubygems

Version Path
hammer_cli_foreman-3.7.0 test/unit/config_report_test.rb
hammer_cli_foreman-3.5.1 test/unit/config_report_test.rb
hammer_cli_foreman-3.6.0 test/unit/config_report_test.rb
hammer_cli_foreman-3.5.0 test/unit/config_report_test.rb
hammer_cli_foreman-3.4.0 test/unit/config_report_test.rb
hammer_cli_foreman-3.3.0 test/unit/config_report_test.rb
hammer_cli_foreman-3.2.0 test/unit/config_report_test.rb
hammer_cli_foreman-2.5.2 test/unit/config_report_test.rb
hammer_cli_foreman-3.1.0 test/unit/config_report_test.rb
hammer_cli_foreman-3.0.0 test/unit/config_report_test.rb
hammer_cli_foreman-2.5.1 test/unit/config_report_test.rb
hammer_cli_foreman-2.5.0 test/unit/config_report_test.rb