Sha256: 43b0251cc94edc161d7e4b04979266bdea04db6baef5d1c13d8f9d4bdd077fe2

Contents?: true

Size: 1.83 KB

Versions: 11

Compression:

Stored size: 1.83 KB

Contents

load "testlib"

SCRATCH=tmp/cucumber-tests

setup() {
  require_gem "cucumber" ">= 1.0"
  rm -rf $SCRATCH
  mkdir -p $SCRATCH
}

teardown() {
  rm -rf $SCRATCH
}

@test "cucumber-queue succeeds when all features pass" {
  run bundle exec cucumber-queue test/samples/features --require test/samples/features/step_definitions
  assert_status 0
  assert_output_contains "Starting test-queue master"
}

@test "cucumber-queue fails when a feature fails" {
  export FAIL=1
  run bundle exec cucumber-queue test/samples/features --require test/samples/features/step_definitions
  assert_status 2
  assert_output_contains "Starting test-queue master"
  assert_output_contains "cucumber test/samples/features/bad.feature:2 # Scenario: failure"
  assert_output_contains "cucumber test/samples/features/sample2.feature:26 # Scenario: failure"
}

@test "cucumber-queue fails when given a missing feature" {
  run bundle exec cucumber-queue test/samples/does_not_exist.feature --require test/samples/features/step_definitions
  assert_status 1
  assert_output_contains "Aborting: Discovering suites failed."
}

@test "cucumber-queue fails when given a malformed feature" {
  [ -f README.md ]
  run bundle exec cucumber-queue README.md --require test/samples/features/step_definitions

  # Cucumber 1 and 2 fail in different ways.
  refute_status 0
  assert_output_matches 'Aborting: Discovering suites failed\.|README\.md: Parser errors:'
}

@test "cucumber-queue handles test file being deleted" {
  cp test/samples/features/*.feature $SCRATCH

  run bundle exec cucumber-queue $SCRATCH --require test/samples/features/step_definitions
  assert_status 0
  assert_output_matches "Feature: Foobar$"

  rm $SCRATCH/sample.feature

  run bundle exec cucumber-queue $SCRATCH --require test/samples/features/step_definitions
  assert_status 0
  refute_output_matches "Feature: Foobar$"
}

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
test-queue-0.7.0 test/cucumber.bats
test-queue-0.6.0 test/cucumber.bats
test-queue-0.5.0 test/cucumber.bats
test-queue-patched-0.4.5 test/cucumber.bats
test-queue-patched-0.4.4 test/cucumber.bats
test-queue-patched-0.4.3 test/cucumber.bats
test-queue-0.4.2 test/cucumber.bats
test-queue-0.4.1 test/cucumber.bats
test-queue-0.4.0 test/cucumber.bats
test-queue-0.3.1 test/cucumber.bats
test-queue-0.3.0 test/cucumber.bats