Sha256: 7a42ddaf6a0055d4fcf5e16eaa29ea2507d72ede6f0c077952c480d50d742237

Contents?: true

Size: 1.06 KB

Versions: 36

Compression:

Stored size: 1.06 KB

Contents

describe 'check-node executable' do

  # Setup a platform for check-node tests
  #
  # Parameters::
  # * Proc: Code called when the platform is setup
  #   * Parameters::
  #     * *repository* (String): Platform's repository
  def with_test_platform_for_check_node
    with_test_platform({ nodes: { 'node' => {} } }) do |repository|
      yield repository
    end
  end

  it 'checks a given node' do
    with_test_platform_for_check_node do
      expect(test_deployer).to receive(:deploy_on).with('node') do
        expect(test_deployer.use_why_run).to eq true
        test_deployer.stdout_device << "Check ok\n"
        { 'node' => [0, "Check ok\n", ''] }
      end
      exit_code, stdout, stderr = run 'check-node', '--node', 'node'
      expect(exit_code).to eq 0
      expect(stdout).to match /Check ok/
      expect(stderr).to eq ''
    end
  end

  it 'fails if no node is given' do
    with_test_platform_for_check_node do
      expect { run 'check-node' }.to raise_error(RuntimeError, 'No node selected. Please use --node option to set at least one.')
    end
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.0.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.18.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.17.1 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.17.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.16.4 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.16.3 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.16.2 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.16.1 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.16.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.15.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.14.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.13.4 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.13.3 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.13.2 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.13.1 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.13.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.12.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.11.2 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.11.1 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb
hybrid_platforms_conductor-32.11.0 spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb