-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
468 lines (443 loc) · 19.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
---
---
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="test-unit.css" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" href="/favicon.png" />
<title>test-unit - a Unit Testing Framework for Ruby</title>
</head>
<body>
<div class="header">
<div class="title">
<a href="./">
<span class="title">a Unit Testing Framework for Ruby</span>
<span class="title-separator">-</span>
<span class="title-project">test-unit</span>
</a>
</div>
<ul class="other-languages">
<li id="other-language-japanese" lang="ja" xml:lang="ja"><a href="ja/index.html">日本語</a></li>
</ul>
<ul class="menu">
<li id="menu-reference"><a href="test-unit/en/">Reference Manual</a></li>
<li id="menu-install"><a href="#test-unit-install">Install</a></li>
<li id="menu-developer"><a href="#developer">Developers</a></li>
</ul>
</div>
<div class="content">
<div class="main">
<h1>test-unit</h1>
<p>
test-unit is a xUnit family unit testing framework for Ruby.
</p>
<h2 id="backward-compatibility">Backward compatibility</h2>
<p>
test-unit 1.2.3 is the same version as bundled in Ruby 1.8.
</p>
<p>
Install:
<pre class="command">% sudo gem install test-unit -v 1.2.3</pre>
</p>
<p>
Usage:
<pre class="code">require "rubygems"
gem "test-unit", "1.2.3"
require "test/unit"</pre>
</p>
<p>
<a href="http://www.rubydoc.info/gems/test-unit/1.2.3">test-unit 1.2.3 reference manual</a>
</p>
<h2 id="feature-split">Feature split</h2>
<p>
test-unit splits some packages by feature. e.g. GTK+ test runner is a different package.
</p>
<p>
Install:
<pre class="command">% sudo gem install test-unit-runner-gtk2</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/runner/gtk2"</pre>
</p>
<p>
You can use --runner=gtk2 option to use GTK+ test runner.
</p>
<p>
Here are test-unit related packages.
</p>
<ul>
<li><a href="#test-unit">test-unit</a>: The core library.</li>
<li><a href="#test-unit-rails">test-unit-rails</a>: A Rails adapter for test-unit.</li>
<li><a href="#test-unit-activesupport">test-unit-activesupport</a>: An Activesupport adapter for test-unit.</li>
<li><a href="#test-unit-full">test-unit-full</a>: A meta package to install test-unit related libraries.</li>
<li><a href="#test-unit-notify">test-unit-notify</a>: A library to notify test result.</li>
<li><a href="#test-unit-rr">test-unit-rr</a>: A library to use test double in test-unit.</li>
<li><a href="#test-unit-capybara">test-unit-capybara</a>: A library to write integration test for Rack applications simply in test-unit.</li>
<li><a href="#test-unit-runner-tap">test-unit-runner-tap</a>: A test runner to provide TAP and TAP-Y/J test output formats.</li>
<li><a href="#test-unit-runner-gtk2">test-unit-runner-gtk2</a>: A test runner by GTK+.</li>
<li><a href="#test-unit-runner-tk">test-unit-runner-tk</a>: A test runner by Tk.</li>
<li><a href="#test-unit-runner-fox">test-unit-runner-fox</a>: A test runner by FOX Toolkit.</li>
</ul>
<h2 id="test-unit">test-unit <a href="https://github.com/test-unit/test-unit/actions/workflows/test.yml?query=branch%3Amaster+"><img src="https://github.com/test-unit/test-unit/actions/workflows/test.yml/badge.svg?branch=master" alt="Build Status for Ruby 2.1+" /></a><a href="https://travis-ci.com/test-unit/test-unit"><img src="https://travis-ci.com/test-unit/test-unit.svg?branch=master" alt="Build Status for Ruby 1.9 and 2.0" /></a></h2>
<p>
This package provides core feature.
</p>
<h3 id="test-unit-latest">test-unit: The latest release</h3>
<p>
<a href="test-unit/en/file.news.html#version-{{ site.test_unit_version | replace: '.', '-' }}">{{ site.test_unit_version }}</a> is the latest release. It had been released at {{ site.test_unit_release_date }}.
</p>
<h3 id="test-unit-install">test-unit: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit</pre>
</p>
<p>
Usage:
<pre class="code">require "test-unit"</pre>
</p>
<h3 id="test-unit-document">test-unit: Document</h3>
<ul>
<li><a href="test-unit/en/">Reference manual</a></li>
</ul>
<h2 id="test-unit-rails">test-unit-rails</h2>
<p>
This is a Rails adapter for test-unit. This also sets <a href="https://rubygems.org/gems/rr">RR</a>, a test double library, and <a href="https://rubygems.org/gems/capybara">Capybara</a>, a library for integration test, up. You can get many features test environment.
</p>
<h3 id="test-unit-rails-latest">test-unit-rails: The latest release</h3>
<p>
<a href="test-unit-rails/en/file.news.html#{{ site.test_unit_rails_version | replace: '.', '-' }}">{{ site.test_unit_rails_version }}</a> is the latest release. It had been released at {{ site.test_unit_rails_release_date }}.
</p>
<h3 id="test-unit-rails-install">test-unit-rails: Install</h3>
<p>
You add the following codes to your Gemfile:
<pre class="code">group :development, :test do
gem 'test-unit-rails'
end</pre>
</p>
<p>
And you update bundled gems:
<pre class="command">% bundle update</pre>
</p>
<p>
You change test/test_helper.rb like the following codes:
<pre class="code"># require 'rails/test_helper'
require 'test/unit/rails/test_help'</pre>
</p>
<h2 id="test-unit-activesupport">test-unit-activesupport</h2>
<p>
This is an Activesupport adapter for test-unit. You can use test-unit 2 instead of minitest as ActiveSupport::TestCase backend.
</p>
<h3 id="test-unit-activesupport-latest">test-unit-activesupport: The latest release</h3>
<p>
<a href="test-unit-activesupport/en/file.news.html#{{ site.test_unit_activesupport_version | replace: '.', '-' }}">{{ site.test_unit_activesupport_version }}</a> is the latest release. It had been released at {{ site.test_unit_activesupport_release_date }}.
</p>
<h3 id="test-unit-activesupport-install">test-unit-activesupport: Install</h3>
<p>
Require test/unit/active_support:
<pre class="code">require "test/unit/active_support"
require "active_support"</pre>
</p>
<p>
Now you can use full test-unit features with ActiveSupport::TestCase.
<pre class="code">require "test/unit/active_support"
require "active_support"
class YourTest < ActiveSupport::TestCase
# ...
end</pre>
</p>
<h2 id="test-unit-full">test-unit-full</h2>
<p>
This is a meta package to use all useful extension packages.
</p>
<h3 id="test-unit-full-latest">test-unit-full: The latest release</h3>
<p>
{{ site.test_unit_full_version }} is the latest release. It had been released at {{ site.test_unit_full_release_date }}.
</p>
<h3 id="test-unit-full-install">test-unit-full: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-full</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/full"</pre>
</p>
<h2 id="test-unit-notify">test-unit-notify</h2>
<p>
<div class="eye-catch">
<img alt="notification on GNOME"
src="test-unit-notify/screenshot/notify-on-gnome.png" />
<img alt="notification on Mac OS X"
src="test-unit-notify/screenshot/notify-on-mac-os-x.png" />
</div>
This package provides a test notifier.
<dl class="feature-list">
<dt>X Window System based environment such ad GNOME, Xfce, KDE and so on</dt>
<dd>"notify-send" command is used for notifying test result.</dd>
<dt>Mac OS X</dt>
<dd>"growlnotify" command or <a href="https://github.com/alloy/terminal-notifier">terminal-notifier</a> is used for notifying test result.</dd>
<dt>Windows</dt>
<dd>"growlnotify.exe" command is used for notifying test result. You need to install <a href="http://www.growlforwindows.com/">Growl for Windows</a>.</dd>
</dl>
</p>
<h3 id="test-unit-notify-latest">test-unit-notify: The latest release</h3>
<p>
<a href="test-unit-notify/en/file.news.html#version-1-0-4">1.0.4</a> is the latest release. It had been released at 2014-10-13.
</p>
<h3 id="test-unit-notify-install">test-unit-notify: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-notify</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/notify"</pre>
</p>
<p>
You can use --notify option to notify test result by popup at the end.
</p>
<h3 id="test-unit-notify-document">test-unit-notify: Document</h3>
<ul>
<li><a href="test-unit-notify/en/">Reference manual</a></li>
</ul>
<h2 id="test-unit-rr">test-unit-rr</h2>
<p>
This package provides a <a href="https://github.com/rr/rr">RR</a>, a test double library, adapter for test-unit.
</p>
<h3 id="test-unit-rr-latest">test-unit-rr: The latest release</h3>
<p>
<a href="test-unit-rr/en/file.news.html#{{ site.test_unit_rr_version | replace: '.', '-' }}">{{ site.test_unit_rr_version }}</a> is the latest release. It had been released at {{ site.test_unit_rr_release_date }}.
</p>
<h3 id="test-unit-rr-install">test-unit-rr: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-rr</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/rr"</pre>
</p>
<h3 id="test-unit-rr-document">test-unit-rr: Document</h3>
<ul>
<li><a href="test-unit-rr/en/">Reference manual</a></li>
</ul>
<h2 id="test-unit-capybara">test-unit-capybara</h2>
<p>
This package provides a <a href="https://github.com/jnicklas/capybara">Capybara</a>, an integration testing helper library for Rack applications, adapter for test-unit.
</p>
<h3 id="test-unit-capybara-latest">test-unit-capybara: The latest release</h3>
<p>
<a href="test-unit-capybara/en/file.news.html#{{ site.test_unit_capybara_version | replace: '.', '-' }}">{{ site.test_unit_capybara_version }}</a> is the latest release. It had been released at {{ site.test_unit_capybara_release_date }}.
</p>
<h3 id="test-unit-capybara-install">test-unit-capybara: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-capybara</pre>
</p>
<p>
Usage:
<pre class="code"><code>require 'test/unit/capybara'
class MyRackApplication
def call(env)
html = <<-HTML
<html>
<head>
<title>Welcome! - my site</title>
</head>
<body>
<h1>Welcome!</h1>
<div class="header">
<p>No navigation.</p>
</div>
</body>
</html>
HTML
[200, {"Content-Type" => "text/html"}, [html]]
end
end
class TestMyRackApplication < Test::Unit::TestCase
include Capybara::DSL
def setup
Capybara.app = MyRackApplication.new
end
def test_title
visit("/")
within("h1") do
assert_equal("Welcome!", text)
end
end
def test_no_sidebar
visit("/")
within("body") do
assert_not_find(".sidebar")
end
end
def test_header_content
visit("/")
within(".header") do
find("ol.navi")
# This fails with the following message:
#
# <"ol.navi">(:css) expected to find a element in
# <<div class="header">
# <p>No navigation.</p>
# </div>>
#
# This messages shows the current context. You don't need to
# entire HTML. You just see the current context moved by "within".
# It helps you debug a problem without save_and_open_page.
end
end
end</code></pre>
</p>
<h3 id="test-unit-capybara-document">test-unit-capybara: Document</h3>
<ul>
<li><a href="test-unit-capybara/en/">Reference manual</a></li>
</ul>
<h2 id="test-unit-runner-tap">test-unit-runner-tap</h2>
<p>
This package provides a test runner that provides TAP and TAP-Y/J test output formats.
</p>
<h3 id="test-unit-runner-tap-latest">test-unit-runner-tap: The latest release</h3>
<p>
1.0.0 is the latest release. It had been released at 2012-02-06.
</p>
<h3 id="test-unit-runner-tap-install">test-unit-runner-tap: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-runner-tap</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/runner/tap"</pre>
</p>
<p>
You can use --runner=tap, --runner=tapy and --runner=tapj to output test results in TAP and TAP-Y/J format.
</p>
<h2 id="test-unit-runner-gtk2">test-unit-runner-gtk2</h2>
<p>
This package provides a GTK+ based test runner.
</p>
<h3 id="test-unit-runner-gtk2-latest">test-unit-runner-gtk2: The latest release</h3>
<p>
0.0.2 is the latest release. It had been released at 2011-02-09.
</p>
<h3 id="test-unit-runner-gtk2-install">test-unit-runner-gtk2: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-runner-gtk2</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/runner/gtk2"</pre>
</p>
<p>
You can use --runner=gtk2 to run tests with GTK+ based test runner.
</p>
<h2 id="test-unit-runner-tk">test-unit-runner-tk</h2>
<p>
This package provides a Tk based test runner.
</p>
<h3 id="test-unit-runner-tk-latest">test-unit-runner-tk: The latest release</h3>
<p>
0.0.1 is the latest release. It had been released at 2008-06-17.
</p>
<h3 id="test-unit-runner-tk-install">test-unit-runner-tk: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-runner-tk</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/runner/tk"</pre>
</p>
<p>
You can use --runner=tk to run tests with Tk based test runner.
</p>
<h2 id="test-unit-runner-fox">test-unit-runner-fox</h2>
<p>
This package provides a FOX Toolkit based test runner.
</p>
<h3 id="test-unit-runner-fox-latest">test-unit-runner-fox: The latest release</h3>
<p>
0.0.1 is the latest release. It had been released at 2008-06-17.
</p>
<h3 id="test-unit-runner-fox-install">test-unit-runner-fox: Install</h3>
<p>
Install:
<pre class="command">% sudo gem install test-unit-runner-fox</pre>
</p>
<p>
Usage:
<pre class="code">require "test/unit/runner/fox"</pre>
</p>
<p>
You can use --runner=fox to run tests with Fox toolkit based test runner.
</p>
<h2 id="developer">For developers</h2>
<p>
test-unit welcome to your contributions.
</p>
<h3 id="repository">Repositories</h3>
<p>
test-unit uses <a href="https://github.com/test-unit/">git repository on GitHub</a>. Here is a list to get each source code.
</p>
<dl>
<dt><a href="https://github.com/test-unit/test-unit/">test-unit</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-rails/">test-unit-rails</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-rails.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-activesupport/">test-unit-activesupport</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-activesupport.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-full/">test-unit-full</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-full.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-notify/">test-unit-notify</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-notify.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-rr/">test-unit-rr</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-rr.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-capybara/">test-unit-capybara</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-capybara.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-runner-gtk2/">test-unit-runner-gtk2</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-runner-gtk2.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-runner-tk/">test-unit-runner-tk</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-runner-tk.git</pre></dd>
<dt><a href="https://github.com/test-unit/test-unit-runner-fox/">test-unit-runner-fox</a></dt>
<dd><pre class="command">% git clone https://github.com/test-unit/test-unit-runner-fox.git</pre></dd>
</dl>
<h3 id="commit-mail">Commit mail</h3>
<p>
You can receive commit mails from <a href="https://www.commit-email.info/">Commit Email as a Service([email protected])</a>
</p>
</div>
<div class="sidebar">
<h2>About Project</h2>
<ul>
<li><a href="https://github.com/test-unit/test-unit/">Project page</a></li>
</ul>
</div>
</div>
<div class="sponsors">
<p id="sponsor-github">
<a href="https://github.com/test-unit/">
<img src="github-logo.png" width="100" height="45" border="0" alt="GitHub's git repositories are used." />
</a>
</p>
<p id="sponsor-tango">
<a href="http://tango.freedesktop.org/">
<img width="120" height="53" border="0" alt="Tango Desktop Project's icons are used." src="tango-logo.png" />
</a>
</p>
<p id="sponsor-famfamfam">
<a href="http://www.famfamfam.com/">
<img width="120" height="18" border="0" alt="famfamfam.com's flags are used." src="famfamfam-logo.png" />
</a>
</p>
</div>
</body>
</html>