[DRE-commits] [ruby-aruba] 01/98: Added example for minitest
Hideki Yamane
henrich at moszumanska.debian.org
Tue Mar 22 12:20:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
henrich pushed a commit to branch debian/sid
in repository ruby-aruba.
commit 5d5964eb6017248e3f48fee97e00051b27374101
Author: Dennis Günnewig <dg1 at ratiodata.de>
Date: Fri Nov 27 13:07:09 2015 +0100
Added example for minitest
---
README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c4a5da5..fc1e41c 100644
--- a/README.md
+++ b/README.md
@@ -43,6 +43,10 @@ For an up to date list of all supported ruby versions, please see our [`.travis.
## Usage
+Please also see this
+[feature test](https://github.com/cucumber/aruba/blob/master/features/getting_started/supported_testing_frameworks.feature)
+for the most up to date documentation.
+
### Cucumber
To use `aruba` with cucumber, `require` the library in one of your ruby files
@@ -84,7 +88,52 @@ well. One might want to use it together with `rspec`.
### Minitest
-TBD :-)
+1. Add a file named "test/support/aruba.rb" with:
+
+ ~~~ ruby
+ require 'aruba/api'
+ ~~~
+
+2. Add a file named "test/test_helper.rb" with:
+
+ ~~~ruby
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
+
+ if RUBY_VERSION < '1.9.3'
+ ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
+ else
+ ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
+ end
+ ~~~
+
+3. Add a file named "test/use_aruba_with_minitest.rb" with:
+
+ ~~~ruby
+ $LOAD_PATH.unshift File.expand_path('../test', __FILE__)
+
+ require 'test_helper'
+ require 'minitest/autorun'
+
+ class FirstRun < Minitest::Test
+ include Aruba::Api
+
+ def setup
+ aruba_setup
+ end
+
+ def getting_started_with_aruba
+ file = 'file.txt'
+ content = 'Hello World'
+
+ write_file file, content
+ read(file).must_equal [content]
+ end
+ end
+ ~~~
+
+4. Run your tests
+
+ `ruby -Ilib:test test/use_aruba_with_minitest.rb`
## Documentation
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-aruba.git
More information about the Pkg-ruby-extras-commits
mailing list