Sha256: c47c27780007a872a9f54217df07afe3a70921beee0e0513e39bc377a674084c
Contents?: true
Size: 1.91 KB
Versions: 7
Compression:
Stored size: 1.91 KB
Contents
require File.join(File.dirname(__FILE__), 'test_helper') require File.join(File.dirname(__FILE__), 'apipie_resource_mock') require 'hammer_cli_foreman_puppet/class' describe HammerCLIForemanPuppet::PuppetClass do include CommandTestHelper context "ListCommand" do before do ResourceMocks.mock_action_call(:puppetclasses, :index, {}) end let(:cmd) { HammerCLIForemanPuppet::PuppetClass::ListCommand.new("", ctx) } context "parameters" do it_should_accept "no arguments" # FIXME: the command should accept search parameters in future # it_should_accept_search_params end context "output" do let(:expected_record_count) do # data are retuned in specific format HammerCLIForemanPuppet.collection_to_common_format(cmd.resource.call(:index)).first.keys.count end it_should_print_n_records it_should_print_column "Id" it_should_print_column "Name" end end context "InfoCommand" do let(:cmd) { HammerCLIForemanPuppet::PuppetClass::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 context "output" do with_params ["--id=1"] do it_should_print_n_records 1 it_should_print_column "Id" it_should_print_column "Name" end end end context "SCParamsCommand" do before :each do ResourceMocks.smart_class_parameters_index end let(:cmd) { HammerCLIForemanPuppet::PuppetClass::SCParamsCommand.new("", ctx) } context "parameters" do it_should_accept "puppet-class", ["--puppet-class=cls"] it_should_accept "puppet-class-id", ["--puppet-class-id=1"] # it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver end end end
Version data entries
7 entries across 7 versions & 1 rubygems