Sha256: 4c5b272005a3d31abee3b1c555588982e47f08b70a76d50f313a052eb786e739

Contents?: true

Size: 1.04 KB

Versions: 29

Compression:

Stored size: 1.04 KB

Contents

describe 'check-node executable' do

  # Setup a platform for check-node tests
  #
  # Parameters::
  # * *block* (Proc): Code called when the platform is setup
  #   * Parameters::
  #     * *repository* (String): Platform's repository
  def with_test_platform_for_check_node(&block)
    with_test_platform({ nodes: { 'node' => {} } }, &block)
  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

29 entries across 29 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.9.2 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.9.1 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.9.0 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.8.4 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.8.3 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.8.2 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.8.1 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.8.0 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.7.4 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.7.3 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.7.2 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.7.1 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.7.0 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.6.0 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.5.1 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.5.0 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.4.0 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.3.0 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.2.4 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb
hybrid_platforms_conductor-33.2.3 spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb