Sha256: 2a0329b5e200aea5ba15207f7d35b94ccd8d902680bfc0ad67356e84b9424298

Contents?: true

Size: 1.51 KB

Versions: 6

Compression:

Stored size: 1.51 KB

Contents

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

require 'hammer_cli_foreman/report'

describe HammerCLIForeman::Report do

  include CommandTestHelper

  context "ListCommand" do

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

    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_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::Report::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::Report::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

6 entries across 6 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.4.0 test/unit/report_test.rb
hammer_cli_foreman-0.3.0 test/unit/report_test.rb
hammer_cli_foreman-0.2.0 test/unit/report_test.rb
hammer_cli_foreman-0.1.4 test/unit/report_test.rb
hammer_cli_foreman-0.1.3 test/unit/report_test.rb
hammer_cli_foreman-0.1.2 test/unit/report_test.rb