Sha256: 8d5660a9a12b1ea5f56a2ad87db33487a87cd0b085299b341a9ca5a52ca46738

Contents?: true

Size: 1.52 KB

Versions: 8

Compression:

Stored size: 1.52 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) { 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::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

8 entries across 8 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.9.0 test/unit/report_test.rb
hammer_cli_foreman-0.8.0 test/unit/report_test.rb
hammer_cli_foreman-0.7.0 test/unit/report_test.rb
hammer_cli_foreman-0.6.2 test/unit/report_test.rb
hammer_cli_foreman-0.6.1 test/unit/report_test.rb
hammer_cli_foreman-0.6.0 test/unit/report_test.rb
hammer_cli_foreman-0.5.1 test/unit/report_test.rb
hammer_cli_foreman-0.5.0 test/unit/report_test.rb