Skip to content

Commit

Permalink
Merge pull request #643 from cucumber/unify-branches-master
Browse files Browse the repository at this point in the history
Improve cucumber features
  • Loading branch information
mvz authored Jun 10, 2019
2 parents 89d6ba9 + 3424c1d commit 0da4fdd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 112 deletions.
72 changes: 0 additions & 72 deletions features/.nav

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -103,33 +103,12 @@ Feature: All output of commands which were executed
When I run `cucumber`
Then the features should all pass

@posix
Scenario: Detect exact one-line output for posix commands
Scenario: Detect exact one-line output
Given a file named "features/output.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
When I run `printf 'hello world'`
Then the output should contain exactly:
\"\"\"
hello world
\"\"\"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Detect exact one-line output for ruby commands
Given an executable named "bin/aruba-test-cli" with:
"""ruby
#!/usr/bin/env ruby
print "hello world"
"""
And a file named "features/output.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
When I run `aruba-test-cli`
When I run `echo 'hello world'`
Then the output should contain exactly:
\"\"\"
hello world
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,18 @@ Feature: Stop commands
Given the default aruba stop signal is "HUP"
And the default aruba exit timeout is 0.2 seconds
When I run `aruba-test-cli`
And I terminate the command started last
Then the exit status should be 155
"""
When I run `cucumber`
Then the features should all pass

@unsupported-on-platform-java
Scenario: STDERR/STDOUT is written normally if output was written in "signal"-handler
Scenario: STDERR/STDOUT is captured from signal handlers

STDERR/STDOUT is written normally on MRI if output was written in "signal"-handler

This is currently broken on JRuby.

Given an executable named "bin/aruba-test-cli1" with:
"""bash
#!/bin/bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Feature: After command hooks
You can hook into Aruba's lifecycle just before it runs a command and after it has run the command:

```ruby
require 'aruba'
Aruba.configure do |config|
config.after :command do |cmd|
puts "After the run of '#{cmd}'"
Expand All @@ -18,10 +17,8 @@ Feature: After command hooks
Given I use a fixture named "cli-app"

Scenario: Run a simple command with an "after(:command)"-hook
Given a file named "spec/support/hooks.rb" with:
Given a file named "spec/support/aruba_config.rb" with:
"""
require_relative 'aruba'
Aruba.configure do |config|
config.after :command do |cmd|
puts "after the run of `#{cmd.commandline}`"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Feature: before_cmd hooks
You can hook into Aruba's lifecycle just before it runs a command and after it has run the command:

```ruby
require_relative 'aruba'

Aruba.configure do |config|
config.before :command do |cmd|
puts "About to run '#{cmd}'"
Expand All @@ -21,10 +19,8 @@ Feature: before_cmd hooks
Given I use a fixture named "cli-app"

Scenario: Run a simple command with a "before(:command)"-hook
Given a file named "spec/support/hooks.rb" with:
Given a file named "spec/support/aruba_config.rb" with:
"""
require_relative 'aruba'
Aruba.configure do |config|
config.before :command do |cmd|
puts "before the run of `#{cmd.commandline}`"
Expand Down
6 changes: 3 additions & 3 deletions features/04_aruba_api/command/run_command.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature: Run command

To run a command use the `#run`-method. There are some configuration options
To run a command use the `#run_command` method. There are some configuration options
which are relevant here:

- `startup_wait_time`:
Expand Down Expand Up @@ -166,7 +166,7 @@ Feature: Run command
Scenario: Mixing commands with long and short startup phase

If you commands with a long and short startup phases, you should consider
using the `startup_wait_time`-option local to the `#run`-call.
using the `startup_wait_time`-option local to the `#run_command`-call.

Given an executable named "bin/aruba-test-cli1" with:
"""bash
Expand Down Expand Up @@ -255,7 +255,7 @@ Feature: Run command
Scenario: Mixing long and short running commands

If need to mix "long running" and "short running" commands, you should consider using the
`exit_timeout`-option local to the `#run`-method.
`exit_timeout`-option local to the `#run_command`-method.

Given an executable named "bin/aruba-test-cli1" with:
"""bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Prepend environment variable

Each variable name and each value is converted to a string. Otherwise `ruby`
would complain about an invalid argument. To make use of a variable you can
either use `#run` and the like or `#with_environment`.
either use `#run_command` and the like or `#with_environment`.

Background:
Given I use the fixture "cli-app"
Expand Down
2 changes: 0 additions & 2 deletions fixtures/empty-app/lib/cli/app.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
require 'cli/app/version'

::Dir.glob(File.expand_path('../**/*.rb', __FILE__)).each { |f| require_relative f }

module Cli
module App
# Your code goes here...
Expand Down

0 comments on commit 0da4fdd

Please sign in to comment.