aruba 0.7.4 → 0.8.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.nav +12 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +12 -0
  6. data/.simplecov +2 -0
  7. data/.travis.yml +5 -6
  8. data/Gemfile +53 -26
  9. data/History.md +17 -0
  10. data/LICENSE +1 -1
  11. data/README.md +45 -19
  12. data/Rakefile +12 -2
  13. data/TODO.md +3 -0
  14. data/aruba.gemspec +19 -8
  15. data/cucumber.yml +1 -1
  16. data/features/api/cd.feature +119 -0
  17. data/features/api/command/run.feature +37 -0
  18. data/features/api/command/which.feature +37 -0
  19. data/features/api/environment/append_environment_variable.feature +118 -0
  20. data/features/api/environment/prepend_environment_variable.feature +118 -0
  21. data/features/api/environment/set_environment_variable.feature +252 -0
  22. data/features/configuration/exit_timeout.feature +51 -0
  23. data/features/configuration/fixtures_directories.feature +31 -0
  24. data/features/configuration/fixtures_path_prefix.feature +24 -0
  25. data/features/configuration/io_timeout.feature +31 -0
  26. data/features/configuration/keep_ansi.feature +31 -0
  27. data/features/configuration/root_directory.feature +31 -0
  28. data/features/configuration/working_directory.feature +32 -0
  29. data/features/fixtures/cli-app/.gitignore +9 -0
  30. data/features/fixtures/cli-app/.rspec +2 -0
  31. data/features/fixtures/cli-app/README.md +34 -0
  32. data/features/fixtures/cli-app/Rakefile +1 -0
  33. data/features/fixtures/cli-app/bin/cli +6 -0
  34. data/features/fixtures/cli-app/cli-app.gemspec +26 -0
  35. data/features/fixtures/cli-app/features/support/env.rb +1 -0
  36. data/features/fixtures/cli-app/lib/cli/app.rb +13 -0
  37. data/features/fixtures/cli-app/lib/cli/app/version.rb +5 -0
  38. data/features/fixtures/cli-app/script/console +14 -0
  39. data/features/fixtures/cli-app/spec/cli/app_spec.rb +7 -0
  40. data/features/fixtures/cli-app/spec/spec_helper.rb +10 -0
  41. data/features/fixtures/copy/file.txt +1 -1
  42. data/features/hooks/after/command.feature +34 -0
  43. data/features/hooks/before/command.feature +61 -0
  44. data/features/matchers/directory/have_sub_directory.feature +110 -0
  45. data/features/matchers/file/be_existing_file.feature +82 -0
  46. data/features/matchers/file/have_file_content.feature +123 -0
  47. data/features/matchers/file/have_file_size.feature +107 -0
  48. data/features/matchers/path/be_an_absolute_path.feature +74 -0
  49. data/features/matchers/path/be_an_existing_path.feature +97 -0
  50. data/features/matchers/path/have_permissions.feature +118 -0
  51. data/features/matchers/timeouts.feature +48 -0
  52. data/features/step_definitions/aruba_dev_steps.rb +69 -1
  53. data/features/steps/commands/exit_statuses.feature +136 -0
  54. data/features/steps/commands/in_process.feature +129 -0
  55. data/features/steps/commands/run.feature +36 -0
  56. data/features/steps/environment/home_variable.feature +49 -0
  57. data/features/steps/environment/set_environment_variable.feature +34 -0
  58. data/features/support/aruba.rb +5 -0
  59. data/features/support/env.rb +8 -4
  60. data/lib/aruba.rb +20 -8
  61. data/lib/aruba/announcer.rb +1 -0
  62. data/lib/aruba/api.rb +18 -1179
  63. data/lib/aruba/api/command.rb +351 -0
  64. data/lib/aruba/api/core.rb +141 -0
  65. data/lib/aruba/api/deprecated.rb +549 -0
  66. data/lib/aruba/api/environment.rb +61 -0
  67. data/lib/aruba/api/filesystem.rb +305 -0
  68. data/lib/aruba/api/rvm.rb +39 -0
  69. data/lib/aruba/aruba_path.rb +75 -0
  70. data/lib/aruba/basic_configuration.rb +208 -0
  71. data/lib/aruba/basic_configuration/option.rb +25 -0
  72. data/lib/aruba/config.rb +43 -30
  73. data/lib/aruba/config/jruby.rb +14 -0
  74. data/lib/aruba/config_wrapper.rb +17 -0
  75. data/lib/aruba/contracts/relative_path.rb +13 -0
  76. data/lib/aruba/creators/aruba_file_creator.rb +32 -0
  77. data/lib/aruba/creators/aruba_fixed_size_file_creator.rb +32 -0
  78. data/lib/aruba/cucumber.rb +87 -53
  79. data/lib/aruba/cucumber/hooks.rb +65 -10
  80. data/lib/aruba/environment.rb +121 -0
  81. data/lib/aruba/errors.rb +3 -0
  82. data/lib/aruba/extensions/string/strip.rb +24 -0
  83. data/lib/aruba/hooks.rb +54 -0
  84. data/lib/aruba/jruby.rb +4 -9
  85. data/lib/aruba/matchers/command.rb +1 -79
  86. data/lib/aruba/matchers/command/be_successfully_executed.rb +30 -0
  87. data/lib/aruba/matchers/command/have_exit_status.rb +47 -0
  88. data/lib/aruba/matchers/command/have_finished_in_time.rb +42 -0
  89. data/lib/aruba/matchers/directory.rb +1 -59
  90. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +34 -0
  91. data/lib/aruba/matchers/directory/have_sub_directory.rb +49 -0
  92. data/lib/aruba/matchers/file.rb +1 -177
  93. data/lib/aruba/matchers/file/be_an_existing_file.rb +34 -0
  94. data/lib/aruba/matchers/file/have_file_content.rb +58 -0
  95. data/lib/aruba/matchers/file/have_file_size.rb +43 -0
  96. data/lib/aruba/matchers/file/have_same_file_content.rb +44 -0
  97. data/lib/aruba/matchers/path.rb +1 -99
  98. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +21 -0
  99. data/lib/aruba/matchers/path/be_an_absolute_path.rb +32 -0
  100. data/lib/aruba/matchers/path/be_an_existing_path.rb +33 -0
  101. data/lib/aruba/matchers/path/have_permissions.rb +60 -0
  102. data/lib/aruba/matchers/path/match_path_pattern.rb +41 -0
  103. data/lib/aruba/matchers/rspec.rb +0 -0
  104. data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +1 -1
  105. data/lib/aruba/platform.rb +230 -0
  106. data/lib/aruba/process_monitor.rb +23 -5
  107. data/lib/aruba/processes/basic_process.rb +35 -1
  108. data/lib/aruba/processes/debug_process.rb +26 -15
  109. data/lib/aruba/processes/in_process.rb +21 -9
  110. data/lib/aruba/processes/spawn_process.rb +29 -19
  111. data/lib/aruba/reporting.rb +2 -0
  112. data/lib/aruba/rspec.rb +61 -13
  113. data/lib/aruba/runtime.rb +33 -0
  114. data/script/bootstrap +4 -6
  115. data/spec/aruba/api/runtime_spec.rb +28 -0
  116. data/spec/aruba/api_spec.rb +129 -126
  117. data/spec/aruba/aruba_path_spec.rb +65 -0
  118. data/spec/aruba/basic_configuration_spec.rb +5 -0
  119. data/spec/aruba/config_wrapper_spec.rb +25 -0
  120. data/spec/aruba/configuration_spec.rb +5 -0
  121. data/spec/aruba/jruby_spec.rb +34 -18
  122. data/spec/aruba/matchers/directory_spec.rb +6 -7
  123. data/spec/aruba/matchers/file_spec.rb +16 -20
  124. data/spec/aruba/matchers/path_spec.rb +14 -11
  125. data/spec/aruba/rspec_spec.rb +15 -0
  126. data/spec/aruba/runtime_spec.rb +29 -0
  127. data/spec/aruba/spawn_process_spec.rb +2 -2
  128. data/spec/spec_helper.rb +10 -2
  129. data/spec/support/configs/rspec.rb +1 -1
  130. data/spec/support/matchers/option.rb +35 -0
  131. data/spec/support/shared_contexts/aruba.rb +10 -8
  132. data/spec/support/shared_examples/configuration.rb +116 -0
  133. metadata +182 -33
  134. data/.rvmrc +0 -1
  135. data/features/before_cmd_hooks.feature +0 -61
  136. data/features/command_environment_variables.feature +0 -31
  137. data/features/custom_ruby_process.feature +0 -12
  138. data/features/exit_statuses.feature +0 -30
  139. data/features/support/custom_main.rb +0 -28
  140. data/lib/aruba/matchers/mode.rb +0 -52
  141. data/lib/aruba/utils.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83f576993314ee79808bc357b48ca134805713e2
4
- data.tar.gz: 7ced0b3d46c1f1a2ff1fb7be028a3486e6d47646
3
+ metadata.gz: 4ec87d782ab5f0a8a1d6edf4343984e6ffc3dd5c
4
+ data.tar.gz: fcfdff23c0e86bd7dc4d731497ef8cfe8e9ccc4c
5
5
  SHA512:
6
- metadata.gz: 0b00a83669a581c4b2698e55f9588370f3fd05dce63b1569d11294e022d10e1536073691ad147fdc024b1867c4248af4ceb15e582e648c4a739c6378160eb1cf
7
- data.tar.gz: a6f951395e4a31f2d5f47f049d0f58f2b999483dd422d5f00dc237452c35257efb6025136828e0ec12a457d1e4aaa6941a8a1adac2383636fbddae5a933de6aa
6
+ metadata.gz: 69ff1ae834613808920fb628a982a55438835504362e2bf4aa82955c57597c52e6a5318247e636693b058d9e55a2f64942f424fbb316d845b2295d93544019c4
7
+ data.tar.gz: f362bb7494704d5f9c331931dc6f29b4258bb46037a6646c38d75d7c104038a187156d0581d87b0b33367edabd17ecf1ae918d66b857d9937ced97f7c4db5acb
data/.gitignore CHANGED
@@ -21,6 +21,7 @@ tags
21
21
  coverage
22
22
  rdoc
23
23
  pkg
24
+ *.log
24
25
 
25
26
  ## PROJECT::SPECIFIC
26
27
  tmp
data/.nav ADDED
@@ -0,0 +1,12 @@
1
+ README.md
2
+ # before_cmd_hooks.feature
3
+ # command_environment_variables.feature
4
+ # configuration-rspec.feature
5
+ # custom_ruby_process.feature
6
+ # exit_statuses.feature
7
+ # file_system_commands.feature
8
+ # flushing.feature
9
+ # interactive.feature
10
+ # no_clobber.feature
11
+ # output.feature
12
+ # utf-8.feature
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --color
2
+ --order random
@@ -10,6 +10,8 @@ Style/HashSyntax:
10
10
  Metrics/ModuleLength:
11
11
  Exclude:
12
12
  - lib/aruba/api.rb
13
+ - lib/aruba/api/*.rb
14
+ - lib/aruba/platform.rb
13
15
 
14
16
  Metrics/AbcSize:
15
17
  Enabled: false
@@ -35,6 +37,10 @@ Lint/UselessAssignment:
35
37
  # Configuration parameters: AllowURI.
36
38
  Metrics/LineLength:
37
39
  Max: 169
40
+ Exclude:
41
+ - lib/aruba/api.rb
42
+ - lib/aruba/api/deprecated.rb
43
+ - aruba.gemspec
38
44
 
39
45
  # Configuration parameters: CountComments.
40
46
  Metrics/MethodLength:
@@ -60,6 +66,9 @@ Style/ClassCheck:
60
66
  Style/ClassVars:
61
67
  Enabled: false
62
68
 
69
+ Metrics/ClassLength:
70
+ Enabled: false
71
+
63
72
  # Cop supports --auto-correct.
64
73
  # Configuration parameters: PreferredMethods.
65
74
  Style/CollectionMethods:
@@ -88,6 +97,9 @@ Style/LeadingCommentSpace:
88
97
  Style/PercentLiteralDelimiters:
89
98
  Enabled: false
90
99
 
100
+ Metrics/PerceivedComplexity:
101
+ Enabled: false
102
+
91
103
  # Configuration parameters: SupportedStyles.
92
104
  Style/RaiseArgs:
93
105
  # EnforcedStyle: compact
data/.simplecov CHANGED
@@ -4,6 +4,8 @@ SimpleCov.start unless ENV.key? 'ARUBA_NO_COVERAGE'
4
4
  SimpleCov.configure do
5
5
  # ignore this file
6
6
  add_filter '.simplecov'
7
+ add_filter 'spec'
8
+ add_filter 'features'
7
9
 
8
10
  # Rake tasks aren't tested with rspec
9
11
  add_filter 'Rakefile'
@@ -3,15 +3,14 @@ language: ruby
3
3
  script: script/test
4
4
  install: script/bootstrap --without development debug
5
5
  rvm:
6
- - 2.1.5
7
- - 2.1.4
8
- - 2.1.3
9
- - 2.1.2
10
- - 2.1.1
11
- - 2.1.0
6
+ - 2.2.2
7
+ - 2.1.6
12
8
  - 2.0.0
9
+ - 1.9.3
10
+ - 1.8.7
13
11
  - jruby-20mode
14
12
  - jruby-21mode
13
+ - jruby
15
14
  - rbx
16
15
  matrix:
17
16
  allow_failures:
data/Gemfile CHANGED
@@ -1,40 +1,67 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ # Use dependencies from gemspec
3
4
  gemspec
4
5
 
5
- group :development, :test do
6
- gem 'simplecov'
7
- end
8
-
6
+ # Debug aruba
9
7
  group :debug do
10
- gem 'pry', '~> 0.10.1 '
11
- gem 'byebug', '~> 4.0.5'
12
- gem 'pry-byebug', '~> 3.1.0'
13
- gem 'pry-stack_explorer', '~> 0.4.9'
14
- gem 'pry-doc', '~> 0.6.0'
8
+ gem 'pry', '~> 0.10.1'
9
+
10
+ platform :ruby_20, :ruby_21, :ruby_22, :jruby, :rbx do
11
+ gem 'byebug', '~> 4.0.5'
12
+ gem 'pry-byebug', '~> 3.1.0'
13
+ end
14
+
15
+ platform :ruby_19 do
16
+ gem 'debugger', '~> 1.6.8'
17
+ gem 'pry-debugger', '~> 0.2.3'
18
+ end
19
+
20
+ platform :ruby_19, :ruby_20, :ruby_21, :ruby_22, :jruby, :rbx do
21
+ gem 'pry-stack_explorer', '~> 0.4.9'
22
+ end
23
+
24
+ gem 'pry-doc', '~> 0.8.0'
15
25
  end
16
26
 
17
27
  group :development, :test do
18
- gem 'bcat', '>= 0.6.1'
19
- gem 'kramdown', '>= 0.14'
20
- gem 'rake', '>= 0.9.2'
21
- gem 'rspec', '>= 3.0.0'
22
- gem 'fuubar', '>= 1.1.1'
23
- gem 'cucumber-pro', '~> 0.0'
24
- gem 'rubocop', '~> 0.31.0'
25
-
26
- gem 'license_finder', '~> 2.0.4'
28
+ # Run development tasks
29
+ gem 'rake', '~> 10.4.2'
30
+
31
+ platform :ruby_19, :ruby_20, :ruby_21, :ruby_22, :jruby, :rbx do
32
+ # Reporting
33
+ gem 'bcat', '~> 0.6.2'
34
+ gem 'kramdown', '~> 1.7.0'
35
+ end
36
+
37
+ # Code Coverage
38
+ gem 'simplecov', '~> 0.10'
39
+
40
+ # Test api
41
+ gem 'rspec', '~> 3.3.0'
42
+ gem 'fuubar', '~> 2.0.0'
43
+
44
+ # Make aruba compliant to ruby community guide
45
+ platform :ruby_19, :ruby_20, :ruby_21, :ruby_22, :jruby, :rbx do
46
+ gem 'rubocop', '~> 0.32.0'
47
+ end
48
+
49
+ platform :ruby_19, :ruby_20, :ruby_21, :ruby_22, :jruby, :rbx do
50
+ gem 'cucumber-pro', '~> 0.0'
51
+ end
52
+
53
+ platform :ruby_19, :ruby_20, :ruby_21, :ruby_22, :jruby, :rbx do
54
+ # License compliance
55
+ gem 'license_finder', '~> 2.0.4'
56
+ end
57
+
58
+ platform :ruby_19, :ruby_20, :ruby_21, :ruby_22, :jruby, :rbx do
59
+ # Upload documentation
60
+ gem 'relish', '~> 0.7.1'
61
+ end
27
62
  end
28
63
 
29
64
  platforms :rbx do
30
65
  gem 'rubysl', '~> 2.0'
31
66
  gem 'rubinius-developer_tools'
32
67
  end
33
-
34
- # Use source from sibling folders (if available) instead of gems
35
- # %w[cucumber].each do |g|
36
- # if File.directory?(File.dirname(__FILE__) + "/../#{g}")
37
- # @dependencies.reject!{|dep| dep.name == g}
38
- # gem g, :path => "../#{g}"
39
- # end
40
- # end
data/History.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [v0.8.0](https://github.com/cucumber/aruba/compare/v0.7.4...v0.8.0)
2
+ * Make aruba compatible with "ruby 1.8.7" and "ruby 1.9.3" again (fixes #279)
3
+ * Move more and more documentation to cucumber steps (partly fixes #268)
4
+ * Refactoring of test suits, now rspec tests run randomly
5
+ * Move Aruba constants to configuration class (fixes #271)
6
+ * Added runtime configuration via `aruba.config` which is reset for each test run
7
+ * Refactored hooks: now there are `after()` and `before()`-hooks, old
8
+ before_cmd-hook is still working, but is deprecated, added new
9
+ `after(:command)`-hook.
10
+ * Refactored jruby-startup helper
11
+ * Cleanup API by moving deprecated methods to separate class
12
+ * Cleanup Core API - reduced to `cd`, `expand_path`, `setup_aruba` and use expand_path wherever possible (fixes #253)
13
+ * Better isolation for environment variable manipulation - really helpful from 1.0.0 on
14
+ * Move configuration files like `jruby.rb` to `aruba/config/`-directory
15
+ * Change default exit timeout to 15 seconds to work around long running processes on travis
16
+
1
17
  ## [v0.7.4](https://github.com/cucumber/aruba/compare/v0.7.2...v0.7.4)
2
18
  * Really Fixed post install message
3
19
 
@@ -21,6 +37,7 @@
21
37
  * Improve development environment (issue #240)
22
38
  * Cleanup process management (issue #257)
23
39
  * Make path content available through matchers and api metchods (issue #250)
40
+ * Refactor announcer to support user defined announce channels (fixes #267)
24
41
 
25
42
  ## [v0.6.2](https://github.com/cucumber/aruba/compare/v0.6.1...v0.6.2)
26
43
  * Fixed minor issue #223)
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010,2011,2012,2013 Aslak Hellesøy, David Chelimsky and Mike Sassak
1
+ Copyright (c) 2010-2015 Aslak Hellesøy, David Chelimsky, Mike Sassak, Jarl Friis, Matt Wynne, Dennis Günnewig
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,24 +1,45 @@
1
- [![Build Status](https://travis-ci.org/cucumber/aruba.png)](http://travis-ci.org/cucumber/aruba)
1
+ [![Build Status](https://travis-ci.org/cucumber/aruba.svg)](http://travis-ci.org/cucumber/aruba)
2
2
  [![Gem Version](https://badge.fury.io/rb/aruba.svg)](http://badge.fury.io/rb/aruba)
3
- [![Dependency Status](https://gemnasium.com/cucumber/aruba.png)](https://gemnasium.com/cucumber/aruba.png)
4
- [![Code Climate](https://codeclimate.com/github/cucumber/aruba.png)](https://codeclimate.com/github/cucumber/aruba)
3
+ [![Dependency Status](https://gemnasium.com/cucumber/aruba.svg)](https://gemnasium.com/cucumber/aruba)
4
+ [![Code Climate](https://codeclimate.com/github/cucumber/aruba.svg)](https://codeclimate.com/github/cucumber/aruba)
5
5
  [![Join the chat at https://gitter.im/cucumber/aruba](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cucumber/aruba?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
6
 
7
- Aruba is Cucumber extension for testing command line applications. Features at a glance:
7
+ `aruba` is an extension for popular TDD and BDD frameworks like "Cucumber" and "RSpec" to make testing of commandline applications meaningful, easy and fun.
8
8
 
9
- * Test any command line application, implemented in any language
10
- * Manipulate the file system
11
- * Automatically reset state of file system between scenarios
9
+ Features at a glance:
12
10
 
13
- ## Usage
11
+ * Test any command line application, implemented in any programming language - e.g. Bash, Python, Ruby, Java
12
+ * Manipulate the file system and the process environment
13
+ * Automatically reset state of file system and process environment between tests
14
14
 
15
- ### Cucumber
15
+ ## Install
16
+
17
+ Add this line to your application's `Gemfile`:
18
+
19
+ gem 'aruba'
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install aruba
16
28
 
17
- If you have a `Gemfile`, add `aruba`. Otherwise, install it like this:
29
+ ### Release Policy
18
30
 
19
- gem install aruba
31
+ We try to be compliant to [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).
20
32
 
21
- Then, `require` the library in one of your ruby files under `features/support` (e.g. `env.rb`)
33
+ ### Supported ruby versions
34
+
35
+ For an up to date list of all supported ruby versions, please see our [`.travis.yml`](https://github.com/cucumber/aruba/blob/master/.travis.yml). We only test against the latest version of a version branch - most times.
36
+
37
+ ## Usage
38
+
39
+ ### Cucumber
40
+
41
+ To use `aruba` with cucumber, `require` the library in one of your ruby files
42
+ under `features/support` (e.g. `env.rb`)
22
43
 
23
44
  ```ruby
24
45
  require 'aruba/cucumber'
@@ -122,22 +143,27 @@ Aruba defines several tags that you can put on on individual scenarios, or on a
122
143
 
123
144
  To get more information on what Aruba is doing, use these tags:
124
145
 
125
- * `@announce-cmd` - See what command is run
146
+ * `@announce-command` - See what command is run
126
147
  * `@announce-stdout` - See the stdout
127
148
  * `@announce-stderr` - See the stderr
128
- * `@announce-dir` - See the current directory
129
- * `@announce-env` - See environment variables set by Aruba
149
+ * `@announce-output` - See the output of stdout and stderr
150
+ * `@announce-directory` - See the current directory
151
+ * `@announce-environment` - See environment variables set by Aruba
130
152
  * `@announce` - Does all of the above
131
153
 
132
154
  ### Adding Hooks
133
155
 
134
- You can hook into Aruba's lifecycle just before it runs a command:
156
+ You can hook into Aruba's lifecycle just before it runs a command and after it has run the command:
135
157
 
136
158
  ```ruby
137
159
  Aruba.configure do |config|
138
- config.before_cmd do |cmd|
160
+ config.before :command do |cmd|
139
161
  puts "About to run '#{cmd}'"
140
162
  end
163
+
164
+ config.after :command do |cmd|
165
+ puts "After the run of '#{cmd}'"
166
+ end
141
167
  end
142
168
  ```
143
169
 
@@ -216,7 +242,7 @@ or setting a hook like this example:
216
242
 
217
243
  ```ruby
218
244
  Aruba.configure do |config|
219
- config.before_cmd do |cmd|
245
+ config.before :command do |cmd|
220
246
  set_env('JRUBY_OPTS', "-X-C #{ENV['JRUBY_OPTS']}") # disable JIT since these processes are so short lived
221
247
  set_env('JAVA_OPTS', "-d32 #{ENV['JAVA_OPTS']}") # force jRuby to use client JVM for faster startup times
222
248
  end
@@ -287,7 +313,7 @@ expand_path('%/song.mp3')
287
313
  let(:path) { expand_path('%/song.mp3') }
288
314
 
289
315
  before :each do
290
- in_current_directory { FileUtils.cp path, 'file.mp3' }
316
+ cd('.') { FileUtils.cp path, 'file.mp3' }
291
317
  end
292
318
 
293
319
  before :each do
data/Rakefile CHANGED
@@ -23,8 +23,18 @@ RSpec::Core::RakeTask.new do |spec|
23
23
  spec.rspec_opts = ['--color', '--format documentation']
24
24
  end
25
25
 
26
- require 'rubocop/rake_task'
27
- RuboCop::RakeTask.new
26
+ if RUBY_VERSION < '1.9'
27
+ begin
28
+ require 'rubocop/rake_task'
29
+ RuboCop::RakeTask.new
30
+ rescue LoadError
31
+ desc 'Stub task to make rake happy'
32
+ task(:rubocop) {}
33
+ end
34
+ else
35
+ require 'rubocop/rake_task'
36
+ RuboCop::RakeTask.new
37
+ end
28
38
 
29
39
  desc "Run tests, both RSpec and Cucumber"
30
40
  task :test => [ :rubocop, :spec, :cucumber, :cucumber_wip]
data/TODO.md ADDED
@@ -0,0 +1,3 @@
1
+
2
+ * Replace check filesystem permissons through a better rspec matcher
3
+ * Improve documentation for matchers in file
@@ -2,23 +2,34 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'aruba'
5
- s.version = '0.7.4'
6
- s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak", "Matt Wynne"]
7
- s.description = 'CLI Steps for Cucumber, hand-crafted for you in Aruba'
5
+ s.version = '0.8.0.pre'
6
+ s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak", "Matt Wynne", "Jarl Friis", "Dennis Günnewig"]
7
+ s.description = 'Extension for popular TDD and BDD frameworks like "Cucumber" and "RSpec" to make testing commandline applications meaningful, easy and fun.'
8
8
  s.summary = "aruba-#{s.version}"
9
9
  s.license = 'MIT'
10
10
  s.email = 'cukes@googlegroups.com'
11
11
  s.homepage = 'http://github.com/cucumber/aruba'
12
12
 
13
- s.add_runtime_dependency 'cucumber', '>= 1.1.1'
14
- s.add_runtime_dependency 'childprocess', '>= 0.3.6'
15
- s.add_runtime_dependency 'rspec-expectations', '>= 2.7.0'
13
+ s.add_runtime_dependency 'cucumber', '~> 1.3.19'
14
+ s.add_runtime_dependency 'childprocess', '~> 0.5.6'
15
+ s.add_runtime_dependency 'rspec-expectations', '~> 3.3'
16
+ s.add_runtime_dependency 'contracts', '~> 0.9'
16
17
 
17
18
  s.add_development_dependency 'bundler', '~> 1.10.2'
18
19
 
19
20
  s.rubygems_version = ">= 1.6.1"
20
- # s.required_ruby_version = '>= 2.0'
21
- s.post_install_message = 'From aruba >= 1.0 ruby 1.9.3-support is discontinued'
21
+ s.required_ruby_version = '>= 1.8.7'
22
+ s.post_install_message = <<-EOS
23
+ With aruba >= 1.0
24
+ * "ruby 1.8.7"-support is discontinued
25
+ * aruba requires "cucumber 2" for the feature steps. The rest of aruba should be usable by whatever testing framework you are using
26
+ * Overwriting methods for configuration is discontinued. You need to use `aruba.config.<variable>` or `Aruba.configure { |config| config.<variable>` instead
27
+ * "aruba/reporting" will be removed. Please use `@debug`-tag + `byebug`, `debugger`, `pry` to troubleshoot your feature tests
28
+ * Set environment variables will have only effect on `#run` and the like + `#with_environment { }`
29
+ * The process environment will be fully resetted between tests. Sharing state via ENV['VAR'] = 'shared state' between tests will not be possible anymore. Please make that obvious by using explicit steps or use the aruba API for that.
30
+ * There will be a major cleanup for command execution. There will be only `run` and `run_simple` left. `run_interactive` is replaced by `run`.
31
+ * Setting the root directory of aruba via method overwrite or configuration - this should be your project root directory where the test suite is run
32
+ EOS
22
33
 
23
34
  s.files = `git ls-files`.split("\n")
24
35
  s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
@@ -1,7 +1,7 @@
1
1
  <%
2
2
  java_version = (RUBY_DESCRIPTION.match(/.*?on.*?(1\.[\d]\..*? )/))[1] if defined?(JRUBY_VERSION)
3
3
 
4
- std_opts = "--color --exclude features/fixtures"
4
+ std_opts = "--color --exclude features/fixtures --require features"
5
5
  java_default_opts = "--tags ~@wip-jruby-java-1.6" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
6
6
  java_wip_opts = "--tags @wip-jruby-java-1.6:3" if defined?(JRUBY_VERSION) && (java_version < '1.7.0')
7
7
  %>
@@ -0,0 +1,119 @@
1
+ Feature: Change current working directory
2
+
3
+ If you need to run some code in a different directory you can use the `cd`
4
+ command. It comes in two flavors:
5
+
6
+ \* First can simply use `cd 'some-dir'`
7
+ \* Second can use the block notation `cd('some-dir') { Dir.getwd }`
8
+
9
+ If you chose to use the latter one, the result of your block is returned. The
10
+ current working directory is only changed for the code inside the block -
11
+ it's use is side effect free.
12
+
13
+ Background:
14
+ Given I use a fixture named "cli-app"
15
+
16
+ Scenario: Existing directory
17
+ Given a file named "spec/cd_spec.rb" with:
18
+ """
19
+ require 'spec_helper'
20
+
21
+ RSpec.describe 'cd to directory', :type => :aruba do
22
+ before(:each) do
23
+ create_directory 'new_dir.d'
24
+ cd 'new_dir.d'
25
+ end
26
+
27
+ before(:each) { run_simple 'pwd' }
28
+
29
+ it { expect(last_command.output).to include 'new_dir.d' }
30
+ end
31
+ """
32
+ When I run `rspec`
33
+ Then the specs should all pass
34
+
35
+ Scenario: Non-Existing directory
36
+ Given a file named "spec/cd_spec.rb" with:
37
+ """
38
+ require 'spec_helper'
39
+
40
+ RSpec.describe 'cd to directory', :type => :aruba do
41
+ before(:each) { cd 'new_dir.d' }
42
+ before(:each) { run_simple 'pwd' }
43
+
44
+ it { expect(last_command.output).to include 'new_dir.d' }
45
+ end
46
+ """
47
+ When I run `rspec`
48
+ Then the specs should not pass
49
+
50
+ Scenario: With block in it-block
51
+ Given a file named "spec/cd_spec.rb" with:
52
+ """
53
+ require 'spec_helper'
54
+
55
+ RSpec.describe 'cd to directory', :type => :aruba do
56
+ before(:each) do
57
+ create_directory 'new_dir.d/subdir.d'
58
+ end
59
+
60
+ it do
61
+ cd('new_dir.d/subdir.d') { expect(Dir.getwd).to include 'new_dir.d/subdir.d' }
62
+ end
63
+ end
64
+ """
65
+ When I run `rspec`
66
+ Then the specs should all pass
67
+
68
+ Scenario: With block in before-block
69
+
70
+ Running `cd` with a block does not change:
71
+
72
+ \* The current directory - `Dir.getwd`
73
+ \* Aruba's current directory
74
+
75
+ Given a file named "spec/cd_spec.rb" with:
76
+ """
77
+ require 'spec_helper'
78
+
79
+ RSpec.describe 'cd to directory', :type => :aruba do
80
+ before(:each) do
81
+ create_directory 'new_dir.d/subdir.d'
82
+ end
83
+
84
+ before :each do
85
+ cd('new_dir.d/subdir.d') do
86
+ # you code
87
+ end
88
+ end
89
+
90
+ it { expect(Dir.getwd).not_to include 'new_dir.d/subdir.d' }
91
+ it { expect(expand_path('.')).not_to include 'new_dir.d/subdir.d' }
92
+ end
93
+ """
94
+ When I run `rspec`
95
+ Then the specs should all pass
96
+
97
+ Scenario: The result of the block is returned
98
+
99
+ If you need to run some code in a different directory, you can also use the
100
+ block-notation of `cd`.
101
+
102
+ Given a file named "spec/cd_spec.rb" with:
103
+ """
104
+ require 'spec_helper'
105
+
106
+ RSpec.describe 'cd to directory', :type => :aruba do
107
+ before(:each) do
108
+ create_directory 'new_dir.d/subdir.d'
109
+ end
110
+
111
+ before :each do
112
+ @my_output = cd('new_dir.d/subdir.d') { Dir.getwd }
113
+ end
114
+
115
+ it { expect(@my_output).to include 'new_dir.d/subdir.d' }
116
+ end
117
+ """
118
+ When I run `rspec`
119
+ Then the specs should all pass