Sha256: 1e5153fe3c35f1e6590388e67fa53f8c0e840b0b9f9b8f114958964323a05652

Contents?: true

Size: 1.15 KB

Versions: 31

Compression:

Stored size: 1.15 KB

Contents

describe 'test executable' do

  # Setup a platform for test tests
  #
  # Parameters::
  # * *block* (Proc): Code called when the platform is setup
  #   * Parameters::
  #     * *repository* (String): Platform's repository
  def with_test_platform_for_test(&block)
    with_test_platform({ nodes: { 'node' => {} } }, &block)
  end

  it 'executes a given test on a given node' do
    with_test_platform_for_test do
      expect(test_tests_runner).to receive(:run_tests).with(['node']) do
        expect(test_tests_runner.tests).to eq [:my_test]
        0
      end
      exit_code, stdout, stderr = run 'test', '--node', 'node', '--test', 'my_test'
      expect(exit_code).to eq 0
      expect(stdout).to eq ''
      expect(stderr).to eq ''
    end
  end

  it 'fails when tests are failing' do
    with_test_platform_for_test do
      expect(test_tests_runner).to receive(:run_tests).with(['node']) do
        expect(test_tests_runner.tests).to eq [:my_test]
        1
      end
      exit_code, stdout, stderr = run 'test', '--node', 'node', '--test', 'my_test'
      expect(exit_code).to eq 1
      expect(stdout).to eq ''
      expect(stderr).to eq ''
    end
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

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