Skip to content

Commit 2f48689

Browse files
committed
Update documentation for latest changes. [doc]
1 parent 0a04ffd commit 2f48689

3 files changed

Lines changed: 66 additions & 21 deletions

File tree

HISTORY.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# RELEASE HISTORY
22

3+
## 0.6.0 / 2013-02-10
4+
5+
This release of Ruby Test takes a hard step back and reconsiders how
6+
to handle configuration from the ground up. Current users of Ruby Test
7+
will probably have to make some adjustments. Our apologies for the extra
8+
work. But the whole thing simply got more complicated than it needed to
9+
be and it was decided that conventional simplicity, with the option
10+
unconventional complexity, was the best approach.
11+
12+
So, to make a long story short. There is no default config file anymore.
13+
The `-p/--profile` command line option has been removed; replaced by
14+
a `-c/--config` option which simply requires a file relative to the current
15+
project. In addition the configuration API had been changed from `Test.run`
16+
or `Test.configure`, to adopt the common convention. And it no longer takes
17+
a profile name for an argument. `Test.run` still has the same interface as
18+
`Test.configure` but it will now run tests immediately! So be sure to change
19+
that if you used it the past. Lastly, Ruby Test now supports DotOpts out of
20+
the box, so its easier then ever to setup default command line options.
21+
22+
Changes:
23+
24+
* Rename `Test.run` to `Test.configure` and remove profile argument.
25+
* Add new `Test.run` to immediately run tests.
26+
* Add `-c/--config` option for requiring project file.
27+
* Add built-in support for DotOpts.
28+
* Deprecate profiles, removing `-p/--profile` cli option.
29+
* Deprecate Test::Runner configuration class methods.
30+
31+
332
## 0.5.4 / 2013-01-22
433

534
This release simply updates configuraiton code to work with RC v0.4.0.

README.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,47 @@ See the [Wiki](http://github.com/rubyworks/test/wiki) for further details.
4848

4949
## Usage
5050

51-
There are a few ways to run tests. First, there is a command line tool:
51+
There are a few ways to run tests. First, there is the command line tool
52+
e.g.
5253

53-
$ rubytest
54+
$ rubytest test/test_*.rb
5455

55-
The command line tool takes various options, use `--help` to see them.
56-
Be sure to load in your test framework or framework's Ruby Test adapter.
56+
The command line tool takes various options, use `-h/--help` to see them.
5757

58-
Preconfigurations can be defined in a `.test` file, e.g.
58+
When running tests, you need to be sure to load in your test framework
59+
or your framework's RubyTest adapter. This is usually done via a helper
60+
script in the test files, but might also be done via command line options,
61+
e.g.
5962

60-
Test.run 'default' do |r|
61-
r.format = 'progress'
62-
r.requires << 'lemon'
63-
r.files << 'test/*_case.rb'
64-
end
63+
$ rubytest -r lemon -r ae test/test_*.rb
6564

66-
There is also a 'rubytest/autorun.rb' library script that can be loaded which
67-
creates an `at_exit` runner, for which `test.rb` provides a nice shortcut:
65+
RubyTest supports [dotopts](http://rubyworks.github.com/dotopts) out of the
66+
box, so it easy to setup reusable options. For example, a `.option` file
67+
entry might be:
6868

69-
$ ruby -r test
69+
rubytest
70+
-f progress
71+
-r spectroscope
72+
-r rspecial
73+
spec/spec_*.rb
7074

71-
There is also a Rake task.
75+
There is also a Rake task. In your Rakefile,
7276

7377
require 'rubytest/rake'
7478

75-
Test::Rake::TestTask.new
79+
Test::Rake::TestTask.new do |run|
80+
require 'lemon'
81+
run.files << 'test/test_*.rb'
82+
end
7683

7784
A Detroit plugin is in the works and should be available soon.
7885

86+
See the Wiki for more information on the different ways to run tests.
87+
88+
89+
Notice the use of `Test.configure` which is .
90+
91+
7992

8093
## Installation
8194

lib/rubytest/config.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ def files
134134
@files ||= []
135135
end
136136

137+
# Format by default is `dotprogress`. The format can also be set
138+
# via the `RUBYTEST_FORMAT` environment variable.
137139
#
140+
# @return [String] format
138141
def format
139-
@format || DEFAULT_FORMAT
142+
@format || ENV['RUBYTEST_FORMAT'] || DEFAULT_FORMAT
140143
end
141144

142145
#
@@ -169,22 +172,22 @@ def units
169172
@unit ||= []
170173
end
171174

172-
#
175+
# Hard is a synonym for assertionless.
173176
def hard
174-
@hard
177+
@hard || Runner.assertionless
175178
end
176179

177-
#
180+
# Hard is a synonym for assertionless.
178181
def hard=(boolean)
179182
@hard = !!boolean
180183
end
181184

182-
#
185+
# Automatically modify the `$LOAD_PATH`?
183186
def autopath
184187
@autopath
185188
end
186189

187-
#
190+
# Automatically modify the `$LOAD_PATH`?
188191
def autopath=(boolean)
189192
@autopath = !!boolean
190193
end

0 commit comments

Comments
 (0)