Sha256: 8945624b0318d345e7b7b667e0018a30d38ac6e0b54e3040f58244dd240ecf19

Contents?: true

Size: 1.09 KB

Versions: 30

Compression:

Stored size: 1.09 KB

Contents

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

require 'hammer_cli_foreman/settings'

describe HammerCLIForeman::Settings do

  include CommandTestHelper

  context "ListCommand" do

    before do
      ResourceMocks.mock_action_call(:settings, :index, [])
    end

    let(:cmd) { HammerCLIForeman::Settings::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 "Name"
      it_should_print_column "Full name"
      it_should_print_column "Value"
      it_should_print_column "Description"
    end

  end

  context "UpdateCommand" do
    let(:cmd) { HammerCLIForeman::Settings::UpdateCommand.new("", ctx) }

    context "parameters" do
      it_should_accept "name", ["--name=setting1", "--value=setting2"]
      it_should_accept "id", ["--id=1", "--value=setting2"]
    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

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