Sha256: 9c61a0e57a92fb7b40d30eebfed2d38b6beaa5bb2fe21bfc1d6d1deaa05f6546

Contents?: true

Size: 1.14 KB

Versions: 19

Compression:

Stored size: 1.14 KB

Contents

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

describe 'status' do
  let(:base_cmd) { %w[status] }

  describe 'foreman' do
    let(:cmd) { base_cmd << 'foreman' }
    let(:status_results) do
      {
        'results' => {
          'foreman' => {
            'database' => { 'active' => true, 'duration_ms' => 0 },
            'version' => '1.24.0-develop',
            'api' => { 'version' => 'v2' },
            'plugins' => [],
            'smart_proxies' => [],
            'compute_resources' => []
          }
        }
      }
    end

    it 'checks status of the foreman system' do
      api_expects(:ping, :statuses, 'Status').returns(status_results)

      output = OutputMatcher.new(
        [
          'Version:           1.24.0-develop',
          'API Version:       v2',
          'Database:',
          '    Status:          ok',
          '    Server Response: Duration: 0ms',
          'Plugins:',
          '',
          'Smart Proxies:',
          '',
          'Compute Resources:'
        ]
      )

      expected_result = success_result(output)
      result = run_cmd(cmd)
      assert_cmd(expected_result, result)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
hammer_cli_foreman-2.3.2 test/functional/status_test.rb
hammer_cli_foreman-2.3.1 test/functional/status_test.rb
hammer_cli_foreman-2.3.0 test/functional/status_test.rb
hammer_cli_foreman-2.1.3 test/functional/status_test.rb
hammer_cli_foreman-2.2.0 test/functional/status_test.rb
hammer_cli_foreman-2.1.2 test/functional/status_test.rb
hammer_cli_foreman-2.1.1 test/functional/status_test.rb
hammer_cli_foreman-2.1.0 test/functional/status_test.rb
hammer_cli_foreman-2.0.2 test/functional/status_test.rb
hammer_cli_foreman-2.0.1 test/functional/status_test.rb
hammer_cli_foreman-2.0.0 test/functional/status_test.rb
hammer_cli_foreman-0.19.7 test/functional/status_test.rb
hammer_cli_foreman-0.19.6 test/functional/status_test.rb
hammer_cli_foreman-0.19.5 test/functional/status_test.rb
hammer_cli_foreman-0.19.4 test/functional/status_test.rb
hammer_cli_foreman-0.19.3 test/functional/status_test.rb
hammer_cli_foreman-0.19.2 test/functional/status_test.rb
hammer_cli_foreman-0.19.1 test/functional/status_test.rb
hammer_cli_foreman-0.19.0 test/functional/status_test.rb