Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from features to documentation #260

Merged
merged 119 commits into from Aug 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
4a57736
Allo exit code as well
maxmeyer Aug 12, 2015
75909d2
Merge branch 'master' of github.com:dg-ratiodata/aruba
maxmeyer Aug 12, 2015
5150721
Improve documentation
maxmeyer Jul 19, 2015
48b32cc
Added new matchers to check output
maxmeyer Jul 19, 2015
da49c59
Improve existing specs
maxmeyer Jul 19, 2015
8cc322b
Move disk usage to separate class
maxmeyer Jul 19, 2015
8e470bd
Determine file size of a given file
maxmeyer Jul 19, 2015
0d57780
Added tasks to TODO file
maxmeyer Jul 19, 2015
425c29e
Ignore flagged features
maxmeyer Jul 19, 2015
3fd8480
Improve announcer
maxmeyer Jul 19, 2015
c1d247c
Added method to return all commands
maxmeyer Jul 19, 2015
05784e4
Remove first assert methods from cucumber api
maxmeyer Jul 19, 2015
544ac7c
Return self after clearance
maxmeyer Jul 19, 2015
cdbee61
Starting a command is not a suprising action, no need to use ! here
maxmeyer Jul 19, 2015
3318dee
Improve handling of io
maxmeyer Jul 19, 2015
e899c85
Better name for last_command
maxmeyer Jul 19, 2015
4b14cc6
Some minor improvements
maxmeyer Jul 19, 2015
85cae62
Added some new steps to for cucumber
maxmeyer Jul 19, 2015
d7b48a4
Use new name for last_command everywhere
Jul 20, 2015
c98b7cd
Fix wrong namespace for platform
Jul 20, 2015
b9ee738
Fixed bugs for reading and specs
Jul 20, 2015
03a3d6d
Environment variables from leaking into other specs
Jul 20, 2015
1b59c43
Use the correct matcher. Have Content is something different from Have
Jul 20, 2015
b245fbf
Use new start method instead of deprecated run-hone
Jul 20, 2015
5e36183
Use the new last_command_*-methods
Jul 20, 2015
0a78ed5
Fixed bug while determining disk usage
Jul 20, 2015
8365445
Refactor matchers a bit
Jul 20, 2015
a142895
Get rid of which in processes by setting the ENV from output side of …
Jul 20, 2015
0bb0ac3
Fixed bugs in output features
Jul 20, 2015
b4d5f32
Fixed some other bugs in feature tests
Jul 20, 2015
eacf525
Fixed offense due to deprecation warning
maxmeyer Jul 20, 2015
df8b35a
Relax the use of steps in cucumber
maxmeyer Jul 20, 2015
b8398ae
Remove app_spec. It's not really helpful and makes some tests for col…
maxmeyer Jul 21, 2015
0b7c854
Better error message if an object is/is not included by using a custom
maxmeyer Jul 21, 2015
1d6a0ef
Reduced output if checking an started process, by redefining inspect …
maxmeyer Jul 21, 2015
ac09f0b
Update history
Jul 21, 2015
cc13f8e
Fixed bug with new run-method for commands
Jul 21, 2015
955e6f7
Split up cucumber.rb in multiple files
Jul 21, 2015
877c9f5
Refactor internals of SpawnProcess
Jul 21, 2015
274b332
Use wait_for_io to reduce the waiting time
Jul 21, 2015
3fc7524
Add some documentation for SpawnProcess
Jul 21, 2015
6cfe609
Updated history
Jul 21, 2015
cb9b286
Improved features and steps
Jul 21, 2015
35bc298
This was not supported by ChildProcess
Jul 21, 2015
d82e531
Make sure not content is put to stderr/stdout which will cause a failure
Jul 21, 2015
01e179c
Remove \n at the end to make it easier for users to compare things
Jul 21, 2015
d0f5907
Update history
Jul 21, 2015
123a54d
Make it compatible with ruby 1.9.2
Jul 21, 2015
0d28f4b
Move deprecated methods to correct namespace and add warnings. For so…
maxmeyer Jul 22, 2015
7f8a155
Use correct api for stopping commands
Jul 22, 2015
c86a775
Fixing deprecation warnings
Jul 22, 2015
66648df
Fix offenses
Jul 22, 2015
a484c0a
Fix the use of timeouts
Jul 22, 2015
5b3fcc1
Improved include_an_object-matcher and include methods from All-matchers
Jul 22, 2015
93715c5
Improve handling of announcer
Jul 22, 2015
3f13d67
Disable io buffering for feature test
maxmeyer Jul 22, 2015
89dbfcf
Make aruba accept options on output as well and pass them on
maxmeyer Jul 22, 2015
4549ffd
Make it obvious that the debug launcher does not capture STDERR/STDOUT
maxmeyer Jul 22, 2015
b90a014
Add some more documentation for filesystem commands
Jul 23, 2015
ffbeea5
Add pry to different group to make it installed on travis as well. We…
Jul 23, 2015
d2047ad
Add documentation for fixtures
Jul 23, 2015
9abe321
Improved documentation for file and directory creation
Jul 23, 2015
873f174
Move fixtures to root to prevent them to litter the relish output
Jul 23, 2015
b66cbfd
Fixed wrong use of ::Platform
Jul 23, 2015
f878b19
Remove duplicated method
Jul 23, 2015
04d1e3a
Reverted the fix for ::Platforms for those
Jul 23, 2015
b7f9bc9
Move platform specific stuff to the correct directory
Jul 23, 2015
679dfc5
Use aruba path to check if command is relative
Jul 23, 2015
833bec3
Minor fixes
Jul 23, 2015
7da18fb
Use new exit timeout step
Jul 23, 2015
aee0489
Document the new default value for the fixtures directory
Jul 23, 2015
a8e54ae
Use the correct implementation for disk usage
Jul 23, 2015
09842bc
Migrate that code also to Platform
Jul 23, 2015
9e23853
Better structure for documentation
Jul 23, 2015
300bf16
Enable syntax highlighting on relish
Jul 23, 2015
81aee03
Added move and copy steps to aruba
Jul 23, 2015
00c7751
Now we've got a getting started section
Jul 23, 2015
36d0971
Better sorted
Jul 23, 2015
2b15204
Fixed offenses
Jul 23, 2015
22220c2
Improved documentation
Jul 23, 2015
6e6e5bd
Make it compatible with 1.8.7
Jul 23, 2015
7bb187b
Make sure files are executable
Jul 23, 2015
a05fe83
Explicit conversion to string
Jul 23, 2015
7080ce6
Use path instead of to_s
maxmeyer Jul 23, 2015
6f42d5e
Check if an fixture really exist
maxmeyer Jul 23, 2015
57db0f7
Make them all executable
maxmeyer Jul 23, 2015
2e6bf6c
Refactor code to use one single implementation of with_environment
Jul 24, 2015
b1082c0
Fixed problem with interactive processes
Jul 24, 2015
660f505
Fixed offenses
maxmeyer Jul 24, 2015
4fcaa4c
Ignore features on ruby < 1.9.3
maxmeyer Jul 24, 2015
3052363
Longer timeout for rubygems
maxmeyer Jul 24, 2015
549887d
Remove dots AND trailing slash
maxmeyer Aug 1, 2015
7b59bef
Bring back unescape_text etc
Aug 7, 2015
ff50fbb
Fixed name of file in feature-test
Aug 7, 2015
a13ba4c
Added documentation for usage of configuration
Aug 7, 2015
3e6ccd4
Fixed problem with timeouts by really using the configuration
Aug 7, 2015
bd8e561
Replace all with all_objects to work around #288
Aug 7, 2015
7a3a95a
Fixed version tag
Aug 12, 2015
1a2bc28
Fixed bugs in feature tests
Aug 12, 2015
a7a83b6
Fixed bug in test
Aug 12, 2015
7cc35cb
Use older pry version for 1.8.7
Aug 12, 2015
2383356
Make the process the leader of the group
maxmeyer Aug 12, 2015
8f70fbb
Resolve path to command to workaround jarib/childprocess#89
maxmeyer Aug 12, 2015
d723f50
Remove debug code
maxmeyer Aug 12, 2015
484abb9
Replace ruby scripts through bash scripts wherever possible
maxmeyer Aug 12, 2015
d982ffa
Fixed test
maxmeyer Aug 13, 2015
9f80fc0
Explicit conversion to array
maxmeyer Aug 13, 2015
f0fb7de
Fixed bug with ruby 1.8.7
Aug 13, 2015
dc77552
We should stop the commands before we try to access the output
Aug 13, 2015
d91826f
Stop commands here as well
maxmeyer Aug 13, 2015
54cc2d1
Should only work from 1.9.3 on
maxmeyer Aug 13, 2015
cedf79e
Stop commands before going on
maxmeyer Aug 14, 2015
cb3d136
Replace tag @ignore-* through @unsupported-on-* to make it's intend c…
maxmeyer Aug 14, 2015
8cc4f3f
Stop those ones too
maxmeyer Aug 14, 2015
99bf288
Move away from rspec's base class
Aug 14, 2015
13ef7cb
Introduce stop_all_commands again
Aug 14, 2015
81b10d8
Fix some bugs
Aug 14, 2015
97d85ec
Fixed missing @ignore tag in cucumber yml
Aug 14, 2015
da5e170
Higher timeout to make it pass on travis
maxmeyer Aug 15, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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