Sha256: fbfe3e1a7715c66562d387f83854c9d3666fb66cdbcdfc8bf10ff4e23030fae8

Contents?: true

Size: 1.42 KB

Versions: 25

Compression:

Stored size: 1.42 KB

Contents

require 'cosmos/tools/test_runner/test'

# This Test demonstrates the usage of the setup and teardown methods
# as well as defining two tests. Notice that the setup and teardown
# methods must be called exactly that. Other test methods must start
# with 'test_' to be picked up by TestRunner.
class ExampleTest < Cosmos::Test
  def setup
    puts "Running ExampleTest setup"
  end

  def test_case_with_long_name_1
    puts "Running test_1"
    Cosmos::Test.puts "This test verifies requirement 1"
    check_expression("false == true")
    puts "continue after error"
  end

  def test_2
    puts "Running test_2"
    Cosmos::Test.puts "This test verifies requirement 2"
    if $manual
      puts "manual"
    else
      puts "not manual"
    end
  end

  def test_3xx
    raise SkipTestCase, "test_3xx unimplemented"
  end

  # Teardown the test case by doing other stuff
  def teardown
    puts "Running ExampleTest teardown"
  end

  def helper_method

  end
end

class ExampleTestSuite < Cosmos::TestSuite
  # This setup applies to the entire test suite
  def setup
    puts "Running ExampleTestSuite setup"
  end

  def initialize
    super()
    add_test_setup('ExampleTest')
    add_test('ExampleTest')
    add_test_teardown('ExampleTest')
  end

  # This teardown applies to the entire test suite
  def teardown
    puts "Running ExampleTestSuite teardown"
  end
end

class NoneTestSuite < Cosmos::TestSuite
  def initialize
    super()
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
cosmos-3.8.3 autohotkey/procedures/example_test.rb
cosmos-3.8.2 autohotkey/procedures/example_test.rb
cosmos-3.8.1 autohotkey/procedures/example_test.rb
cosmos-3.8.0 autohotkey/procedures/example_test.rb
cosmos-3.7.1 autohotkey/procedures/example_test.rb
cosmos-3.7.0 autohotkey/procedures/example_test.rb
cosmos-3.6.3 autohotkey/procedures/example_test.rb
cosmos-3.6.2 autohotkey/procedures/example_test.rb
cosmos-3.6.1 autohotkey/procedures/example_test.rb
cosmos-3.6.0 autohotkey/procedures/example_test.rb
cosmos-3.5.3 autohotkey/procedures/example_test.rb
cosmos-3.5.2 autohotkey/procedures/example_test.rb
cosmos-3.5.0 autohotkey/procedures/example_test.rb
cosmos-3.4.2 autohotkey/procedures/example_test.rb
cosmos-3.4.1 autohotkey/procedures/example_test.rb
cosmos-3.4.0 autohotkey/procedures/example_test.rb
cosmos-3.3.3 autohotkey/procedures/example_test.rb
cosmos-3.3.2 autohotkey/procedures/example_test.rb
cosmos-3.3.1 autohotkey/procedures/example_test.rb
cosmos-3.3.0 autohotkey/procedures/example_test.rb