README.md in aruba-0.4.11 vs README.md in aruba-0.5.0

- old
+ new

@@ -34,15 +34,18 @@ end ### Modify the PATH -If testing an executable in your project's `bin` directory, it might not be in the `PATH` Aruba -uses. An easy way to set it is to put the following in `features/support/env.rb`: +Aruba will automatically add the `bin` directory of your project to the `PATH` environment variable for +the duration of each Cucumber scenario. So if you're developing a Ruby gem with a binary command, you +can test those commands as though the gem were already installed. - ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}" +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']}" + ### 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: Before do @@ -77,14 +80,14 @@ ### Adding Hooks You can hook into Aruba's lifecycle just before it runs a command: -``` +```ruby Aruba.configure do |config| config.before_cmd do |cmd| - puts "About to run '#{cmd}' + puts "About to run '#{cmd}'" end end ``` #### Keep files around with `@no-clobber` @@ -95,9 +98,40 @@ Aruba strips away ANSI escapes from the stdout and stderr of spawned child processes by default. It's usually rather cumbersome to make assertions about coloured output. Still, there might be cases where you want to leave the ANSI escapes intact. Just tag your scenario with `@ansi`. Alternatively you can add your own Before hook that sets `@aruba_keep_ansi = true`. + +### JRuby Tips + +Improve startup time by disabling JIT and forcing client JVM mode. This can be accomplished by adding + + require 'aruba/java' + +or setting a hook like this example: + +``` + Aruba.configure do |config| + config.before_cmd do |cmd| + set_env('JRUBY_OPTS', "-X-C #{ENV['JRUBY_OPTS']}") # disable JIT since these processes are so short lived + set_env('JAVA_OPTS', "-d32 #{ENV['JAVA_OPTS']}") # force jRuby to use client JVM for faster startup times + end + end if RUBY_PLATFORM == 'java' +``` + +*Note* - no conflict resolution on the JAVA/JRuby environment options is +done; only merging. For more complex settings please manually set the +environment variables in the hook or externally. + +A larger process timeout for java may be needed + +``` + Before do + @aruba_timeout_seconds = RUBY_PLATFORM == 'java' ? 60 : 10 + end +``` + +Refer to http://blog.headius.com/2010/03/jruby-startup-time-tips.html for other tips on startup time. ## Reporting *Important* - you need [Pygments](http://pygments.org/) installed to use this feature.