Sha256: 52cb9f3d813c6f8b196d48e3c0bfdfcecb98b9ae120849d79a437d28c6df9f50

Contents?: true

Size: 761 Bytes

Versions: 20

Compression:

Stored size: 761 Bytes

Contents

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

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

  describe 'foreman' do
    let(:cmd) { base_cmd << 'foreman' }
    let(:ping_results) do
      {
        'results' => {
          'foreman' => {
            'database' => { 'active' => true, 'duration_ms' => 0 }
          }
        }
      }
    end

    it 'pings foreman system' do
      api_expects(:ping, :ping, 'Ping').returns(ping_results)

      output = OutputMatcher.new(
        [
          'database:',
          '    Status:          ok',
          '    Server Response: Duration: 0ms'
        ]
      )

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

Version data entries

20 entries across 20 versions & 1 rubygems

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