File: raketask.feature

package info (click to toggle)
cucumber 2.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,076 kB
  • sloc: ruby: 17,016; javascript: 4,641; makefile: 12; sh: 10; tcl: 3
file content (44 lines) | stat: -rw-r--r-- 1,189 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@spawn
Feature: Raketask

  In order to use cucumber's rake task
  As a Cuker
  I do not want to see rake's backtraces when it fails
  Also I want to get zero exit status code on failures
  And non-zero exit status code when it pases

  Background:
    Given the standard step definitions
    Given a file named "features/passing_and_failing.feature" with:
      """
      Feature: Sample

        Scenario: Passing
          Given this step passes

        Scenario: Failing
          Given this step raises an error
      """
    Given a file named "Rakefile" with:
      """
        require 'cucumber/rake/task'

        SAMPLE_FEATURE_FILE = 'features/passing_and_failing.feature'

        Cucumber::Rake::Task.new(:pass) do |t|
          t.cucumber_opts = "#{SAMPLE_FEATURE_FILE}:3"
        end

        Cucumber::Rake::Task.new(:fail) do |t|
          t.cucumber_opts = "#{SAMPLE_FEATURE_FILE}:6"
        end
      """

  Scenario: Passing feature
    When I run `bundle exec rake pass`
    Then the exit status should be 0

  Scenario: Failing feature
    When I run `bundle exec rake fail`
    Then the exit status should be 1
    But the output should not contain "rake aborted!"