Sha256: aa2d9c28ba121d72b44bcadb8af6bdbb4498a0be3a707d29de0acb77ed301094

Contents?: true

Size: 827 Bytes

Versions: 24

Compression:

Stored size: 827 Bytes

Contents

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

module ResourceDisabled

  def it_should_fail_when_disabled
    arguments = @with_params ? @with_params.dup : []
    context "resource disabled" do

      it "should return error" do
        cmd.class.resource.stubs(:call).raises(RestClient::ResourceNotFound)
        arguments = respond_to?(:with_params) ? with_params : []
        _(cmd.run(arguments)).must_equal HammerCLI::EX_UNAVAILABLE
      end

      it "should print error message" do
        cmd.class.resource.stubs(:call).raises(RestClient::ResourceNotFound)
        cmd.stubs(:context).returns(ctx.update(:adapter => :test))

        arguments = respond_to?(:with_params) ? with_params : []
        _(lambda { cmd.run(arguments) }).must_output "", /.*not support.*/
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
hammer_cli_foreman_puppet-0.0.7 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.7.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.5.1 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.6.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.5.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.4.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman_puppet-0.0.6 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.3.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman_puppet-0.0.5 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.2.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-2.5.2 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.1.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman_puppet-0.0.4 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman_puppet-0.0.3 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-3.0.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman_puppet-0.0.2 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman_puppet-0.0.1 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-2.5.1 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-2.5.0 test/unit/helpers/resource_disabled.rb
hammer_cli_foreman-2.3.2 test/unit/helpers/resource_disabled.rb