Skip to content

Commit

Permalink
Merge pull request #260 from dg-ratiodata/feature/improve_documentation
Browse files Browse the repository at this point in the history
Move from features to documentation
  • Loading branch information
maxmeyer committed Aug 15, 2015
2 parents dad4adc + da5e170 commit 58143bd
Show file tree
Hide file tree
Showing 155 changed files with 4,651 additions and 1,466 deletions.
12 changes: 0 additions & 12 deletions .nav

This file was deleted.

15 changes: 8 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ gemspec

# Debug aruba
group :debug do
if RUBY_VERSION >= '2'
gem 'pry', '~> 0.10.1'
else
gem 'pry', '~>0.9.12'
end

if RUBY_VERSION >= '2' && !RUBY_PLATFORM.include?('java')
gem 'byebug', '~> 4.0.5'
gem 'pry-byebug', '~> 3.1.0'
end

if RUBY_VERSION < '2' && !RUBY_PLATFORM.include?('java')
if RUBY_VERSION < '2' && RUBY_VERSION > '1.9' && !RUBY_PLATFORM.include?('java')
gem 'debugger', '~> 1.6.8'
gem 'pry-debugger', '~> 0.2.3'
end
Expand All @@ -29,6 +23,13 @@ group :debug do
end

group :development, :test do
# we use this to demonstrate interactive debugging within our feature tests
if RUBY_VERSION >= '2'
gem 'pry', '~> 0.10.1'
else
gem 'pry', '~>0.9.12'
end

# Run development tasks
gem 'rake', '~> 10.4.2'

Expand Down
34 changes: 34 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,18 @@

* First release (David Chelimsky and Aslak Hellesøy)

# Upcoming un-released versions

## [v0.10.0](https://github.com/cucumber/aruba/compare/v0.8.1...v0.9.0)

* Redefine #to_s and #inspect for BasicProcess to reduce the sheer amount of
information, if a command produces a lot of output
* Added new matcher to check if an object is included + a error message for
failures which is similar to the `#all`-matcher of `RSpec`
* Add `have_output`-, `have_output_on_stderr`, `have_output_on_stdout`-matchers
* Replace all `assert_*` and `check_*`-methods through expectations
* Add hook `@announce-output` to output both, stderr and stdout

## [v1.0.0](https://github.com/cucumber/aruba/compare/v0.11.0...v1.0.0)

* Support for rubies older than 1.9.3 is discontinued - e.g 1.8.7 and 1.9.2
Expand Down Expand Up @@ -395,3 +407,25 @@
* Use different working directories based on test suite - RSpec, Cucumber.
It's `tmp/rspec` and `tmp/cucumber` now to make sure they do not overwrite
the test results from each other.
* The use of `@interactive` is discontinued. You need to use
`#last_command_started`-method to get access to the interactively started
command.
* If multiple commands have been started, each output has to be check
separately

```cucumber
Scenario: Detect stdout from all processes
When I run `printf "hello world!\n"`
And I run `cat` interactively
And I type "hola"
And I type ""
Then the stdout should contain:
"""
hello world!
"""
And the stdout should contain:
"""
hola
"""
And the stderr should not contain anything
```
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,19 @@ can test those commands as though the gem were already installed.

If you need other directories to be added to the `PATH`, you can put the following in `features/support/env.rb`:

ENV['PATH'] = "/my/special/bin/path#{File::PATH_SEPARATOR}#{ENV['PATH']}"
```ruby
Aruba.configure do |config|
config.command_search_paths = config.command_search_paths << '/my/special/bin/path'
end
```

### Increasing timeouts

A process sometimes takes longer than expected to terminate, and Aruba will kill them off (and fail your scenario) if it is still alive after 3 seconds. If you need more time you can modify the timeout by assigning a different value to `@aruba_timeout_seconds` in a `Before` block:
A process sometimes takes longer than expected to terminate, and Aruba will kill them off (and fail your scenario) if it is still alive after 3 seconds. If you need more time you can modify the timeout by assigning a different value to `#exit_timeout` in a `Aruba.configure` block:

```ruby
Before do
@aruba_timeout_seconds = 5
Aruba.configure do |config|
config.exit_timeout = 5
end
```

Expand All @@ -132,11 +136,11 @@ end
Running processes interactively can result in race conditions when Aruba executes an IO-related step
but the interactive process has not yet flushed or read some content. To help prevent this Aruba waits
before reading or writing to the process if it is still running. You can control the wait by setting
`@aruba_io_wait_seconds` to an appropriate value. This is particularly useful with tags:
`aruba.config.io_wait_timeout` to an appropriate value. This is particularly useful with tags:

```ruby
Before('@slow_process') do
@aruba_io_wait_seconds = 5
aruba.config.io_wait_timeout = 5
end
```

Expand Down
7 changes: 6 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

* Replace check filesystem permissons through a better rspec matcher
* Improve documentation for matchers in file
* Cleanup stdout/stderr in spawn process:
It should be enough to use 'open(@process.io.stdout).read' and 'open(@process.io.stderr).read'. There's no need to rewind them.
* Ensure that all processes are kill after cucumber is finished
* Add variation of check and stop of command if output contains
Add something like `(?: of last command)?`. If this is true, just check the last command.
* Use aruba.config.exit_timeout everywhere
16 changes: 10 additions & 6 deletions cucumber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
require 'ffi'
java_version = (RUBY_DESCRIPTION.match(/.*?on.*?(1\.[\d]\..*? )/))[1] if defined?(JRUBY_VERSION)
std_opts = "--color --exclude features/fixtures --require features"
std_opts = "--color --exclude features/fixtures --require features --tags ~@unsupported-on"
java_default_opts = "--tags ~@wip-jruby-java-1.6" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
java_wip_opts = "--tags @wip-jruby-java-1.6:3" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
ignore_opts = []
ignore_opts << "--tags ~@ignore-platform-java" if RUBY_PLATFORM.include? 'java'
ignore_opts << "--tags ~@ignore-platform-mri" if !RUBY_PLATFORM.include? 'java'
ignore_opts << "--tags ~@ignore-platform-windows" if FFI::Platform.windows?
ignore_opts << "--tags ~@ignore-platform-unix" if FFI::Platform.unix?
ignore_opts << "--tags ~@ignore-platform-mac" if FFI::Platform.mac?
ignore_opts << '--tags ~@ignore'
ignore_opts << '--tags ~@unsupported-on-platform-java' if RUBY_PLATFORM.include? 'java'
ignore_opts << '--tags ~@unsupported-on-platform-mri' if !RUBY_PLATFORM.include? 'java'
ignore_opts << '--tags ~@unsupported-on-platform-windows' if FFI::Platform.windows?
ignore_opts << '--tags ~@unsupported-on-platform-unix' if FFI::Platform.unix?
ignore_opts << '--tags ~@unsupported-on-platform-mac' if FFI::Platform.mac?
ignore_opts << '--tags ~@unsupported-on-ruby-older-2' if RUBY_VERSION < '2'
ignore_opts << '--tags ~@unsupported-on-ruby-older-193' if RUBY_VERSION < '1.9.3'
ignore_opts << '--tags ~@unsupported-on-ruby-older-19' if RUBY_VERSION < '1.9'
ignore_opts = ignore_opts.join(' ')
%>
default: <%= std_opts %> --tags ~@wip <%= java_default_opts %> <%= ignore_opts %>
Expand Down
72 changes: 72 additions & 0 deletions features/.nav
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
- README.md
- getting_started (Getting Started):
- install.feature (Install Aruba)
- supported_programming_languages.feature (Supportet Programming Languages)
- ruby_api (Ruby API):
- expand_path.feature (#expand_path)
- cleanup_aruba_directory.feature (#setup_aruba)
- run.feature (#run)
- which.feature (#which)
- append_environment_variable.feature (#append_environment_variable)
- prepend_environment_variable.feature (#prepend_environment_variable)
- set_environment_variable.feature (#set_environment_variable)
- cd.feature (#cd)
- create_directory.feature (#create_directory)
- disk_usage.feature (#disk_usage)
- does_exist.feature (#exist?)
- is_absolute.feature (#absolute?)
- filesystem/is_directory.feature (#directory?)
- is_file.feature (#file?)
- is_relative.feature(#relative?)
- move.feature (#move)
- file_system_commands.feature
- command.feature (Before Hook)
- command.feature (After Hook)
- cucumber (Cucumber):
- debug_command.feature (Debug Commmands)
- environment_variables.feature (Environment Variables)
- flushing.feature (Flush Output)
- interactive.feature (Interactive Commands)
- all_output.feature (Command Output)
- stdout.feature (STDOUT)
- configuration (Configuration):
- exit_timeout.feature (Exit Timeout)
- fixtures_directories.feature (Fixtures Directories)
- fixtures_path_prefix.feature (Fixture Path Prefix)
- home_directory.feature (Home Directory)
- io_timeout.feature (IO Wait Timeout)
- keep_ansi.feature (Keep ANSI output)
- log_level.feature (Log Level)
- physical_block_size.feature (Physical Block Size)
- root_directory.feature (Root Directory)
- working_directory.feature (Working Directory)
- rspec (RSpec):
- getting_started.feature (Integration)
- include_an_object.feature (Matcher: Include an Object)
- have_sub_directory.feature (Matcher: Have Sub Directory)
- be_existing_file.feature (Matcher: Be Existing File)
- have_file_content.feature (Matcher: Have File Content)
- have_file_size.feature (Matcher: Have File Size)
- be_an_absolute_path.feature (Matcher: Be Absolute Path)
- be_an_existing_path.feature (Matcher: Be Existing Path)
- have_permissions.feature (Matcher: Have Permissions)
- timeouts.feature (Matcher: Timeouts)
- cucumber (Cucumber):
- announce.feature (Announce Information to User)
- exit_statuses.feature (Exit Status of Commands)
- in_process.feature (Start Commands in Process)
- run.feature (Run Commands)
- home_variable.feature (Modify HOME-Variable)
- set_environment_variable.feature (Set Environment variables)
- copy.feature (Copy files/directories)
- create_directory.feature (Create Directories)
- create_file.feature (Create Files)
- file_content.feature (Use File Content)
- move.feature (Move files/directories)
- overwrite_file.feature (Overwrite Files)
- use_fixture.feature (Use Fixtures)
- output.feature (Output)
- utf-8.feature (Support for UTF-8-strings)
- development (Development):
- build.feature (Build Aruba)
- test.feature (Test Aruba)
Loading

0 comments on commit 58143bd

Please sign in to comment.