別のキーワード
種類
ライブラリ
- ビルトイン (1187)
- csv (156)
- delegate (12)
- erb (60)
- fileutils (36)
-
irb
/ inspector (12) - json (24)
-
json
/ add / exception (12) - logger (48)
-
minitest
/ mock (4) -
minitest
/ spec (6) -
minitest
/ unit (70) - mkmf (12)
-
net
/ http (48) -
net
/ imap (12) -
net
/ smtp (24) - objspace (12)
- openssl (12)
- optparse (84)
- pathname (36)
- rake (744)
-
rake
/ loaders / makefile (12) -
rake
/ packagetask (24) -
rake
/ testtask (240) -
rubygems
/ server (12) -
rubygems
/ source _ index (12) -
rubygems
/ source _ info _ cache (72) -
rubygems
/ spec _ fetcher (12) -
rubygems
/ specification (96) -
rubygems
/ validator (12) - set (18)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - strscan (480)
- syslog (24)
-
test
/ unit (2) - tracer (24)
- uri (12)
- win32ole (36)
クラス
-
ARGF
. class (120) - Binding (7)
- CSV (156)
- Dir (12)
- ERB (60)
- Exception (44)
- File (168)
-
Gem
:: Server (12) -
Gem
:: SourceIndex (12) -
Gem
:: SourceInfoCache (72) -
Gem
:: SpecFetcher (12) -
Gem
:: Specification (96) -
Gem
:: Validator (12) - IO (104)
-
IRB
:: Inspector (12) - Logger (48)
- Method (12)
-
MiniTest
:: Mock (3) -
MiniTest
:: Spec (5) -
MiniTest
:: Unit (23) -
MiniTest
:: Unit :: TestCase (13) - Module (12)
-
Net
:: HTTPGenericRequest (48) -
Net
:: IMAP (12) -
Net
:: SMTP (24) -
ObjectSpace
:: WeakMap (12) -
OpenSSL
:: BN (12) - OptionParser (84)
- Pathname (36)
-
Rake
:: Application (108) -
Rake
:: FileList (240) -
Rake
:: FileTask (24) -
Rake
:: InvocationChain (60) -
Rake
:: MakefileLoader (12) -
Rake
:: NameSpace (12) -
Rake
:: PackageTask (24) -
Rake
:: TaskArguments (72) -
Rake
:: TestTask (228) - Set (24)
- Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - String (87)
- StringScanner (468)
- Thread (24)
- TracePoint (24)
- Tracer (24)
-
URI
:: Generic (12) - WIN32OLE (12)
-
WIN32OLE
_ VARIANT (12)
モジュール
- FileTest (318)
- FileUtils (36)
- GC (24)
-
Gem
:: InstallUpdateOptions (12) - JSON (12)
-
JSON
:: Generator :: GeneratorMethods :: String (12) - Kernel (177)
- MiniTest (2)
-
MiniTest
:: Assertions (26) - ObjectSpace (12)
- Rake (36)
-
Rake
:: Cloneable (24) -
Rake
:: TaskManager (156) - Syslog (24)
-
Test
:: Unit (1)
オブジェクト
- ENV (48)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (24)
- == (12)
- Assertion (1)
- Assertions (1)
-
FL
_ TEST (12) - FileTest (12)
-
MINI
_ DIR (1) - MiniTest (1)
- Mock (1)
-
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) -
PASSTHROUGH
_ EXCEPTIONS (1) - Proc (12)
- RTEST (12)
- Rubyの起動 (4)
- Ruby用語集 (12)
-
SUPPORTS
_ INFO _ SIGNAL (1) - SimpleDelegator (12)
- Skip (1)
- Spec (1)
- StringScanner (12)
- TestCase (1)
- TestTask (12)
- Unit (2)
- VERSION (1)
-
WIN32OLE
_ VARIANT (12) - [] (66)
- []= (12)
-
_ _ name _ _ (1) -
_ assertions (1) -
_ assertions= (1) -
add
_ loader (12) -
add
_ row (12) - after (1)
-
allocation
_ sourcefile (12) - append (24)
- application (12)
- application= (12)
- assert (1)
-
assert
_ block (1) -
assert
_ empty (1) -
assert
_ equal (1) -
assert
_ in _ delta (1) -
assert
_ in _ epsilon (1) -
assert
_ includes (1) -
assert
_ instance _ of (1) -
assert
_ kind _ of (1) -
assert
_ match (1) -
assert
_ nil (1) -
assert
_ operator (1) -
assert
_ raises (1) -
assert
_ respond _ to (1) -
assert
_ same (1) -
assert
_ send (1) -
assert
_ throws (1) -
assertion
_ count (1) -
assertion
_ count= (1) - atime (12)
- autorun (1)
-
backtrace
_ locations (36) - before (1)
-
beginning
_ of _ line? (12) - binmode (12)
- blockdev? (12)
- body (12)
- body= (12)
-
body
_ stream (12) -
body
_ stream= (12) - bol? (12)
-
caller
_ locations (24) -
capture
_ io (1) - chardev? (12)
- check (12)
-
check
_ until (12) - chomp (12)
- chop (12)
- chown (12)
- chr (12)
- clear (24)
-
clear
_ exclude (12) - clone (24)
- close (24)
- closed? (12)
- concat (12)
-
const
_ source _ location (12) -
create
_ makefile (12) -
create
_ rule (12) - ctime (36)
- current (1)
-
current
_ scope (12) -
datetime
_ format (12) -
datetime
_ format= (12) -
def
_ class (12) -
def
_ inspector (12) -
def
_ module (12) - define (12)
-
define
_ task (12) - delete (36)
-
delete
_ if (12) - desc (12)
- directory? (12)
- dump (12)
- dup (24)
-
each
_ char (24) -
each
_ codepoint (24) - egrep (12)
- empty? (21)
- encoding (12)
- eos? (12)
- errors (1)
- errors= (1)
-
exception
_ details (1) -
excluded
_ from _ list? (12) - executable? (12)
-
executable
_ real? (12) - exist? (24)
- existing (12)
- existing! (12)
- exists? (9)
- expect (1)
- ext (12)
- failures (1)
- failures= (1)
- fdatasync (12)
- fetch (12)
- file? (12)
- filter (36)
-
filter
_ backtrace (1) - flunk (1)
- flush (12)
- fnmatch (12)
- formatter (12)
- getc (12)
- gets (36)
- grpowned? (12)
- gsub (48)
- gsub! (12)
-
has
_ test _ suite? (12) -
has
_ unit _ tests? (12) - hash (12)
- identical? (12)
- import (12)
-
in
_ namespace (12) - inherited (1)
- init (12)
-
inplace
_ mode (12) - inspect (30)
-
install
_ update _ defaults _ str (12) - intern (12)
-
internal
_ encoding (12) - invoke (12)
-
is
_ a? (12) - it (1)
-
kind
_ of? (12) - lambda (18)
-
last
_ comment (12) -
last
_ description (12) -
last
_ description= (12) -
latest
_ cache _ data (12) -
latest
_ cache _ file (12) -
latest
_ gc _ info (24) -
latest
_ specs (36) -
latest
_ system _ cache _ file (24) -
latest
_ user _ cache _ file (24) - lchmod (12)
- lchown (12)
- length (12)
- libs (12)
- libs= (12)
- link (12)
- load (12)
- loader (12)
- loader= (12)
- location (1)
- lookup (12)
- mask (12)
- mask= (12)
- match? (12)
- matched (12)
- matched? (12)
-
matched
_ size (12) - member? (12)
-
minitest
/ autorun (12) -
minitest
/ mock (12) -
minitest
/ spec (12) -
minitest
/ unit (12) - mkdir (12)
- move (12)
- mtime (12)
-
mu
_ pp (1) - mv (12)
- name (24)
- name= (12)
- names (12)
- needed? (12)
-
net
/ smtp (12) - new (126)
-
new
_ scope (12) - on (24)
-
on
_ head (12) -
on
_ tail (12) - open (72)
-
original
_ dir (24) - output= (1)
- owned? (12)
-
package
_ files (12) -
package
_ files= (12) - parse (24)
- parse! (12)
- pass (1)
- passed? (1)
- path (12)
- pathmap (12)
- pattern (12)
- pattern= (12)
- peek (12)
- peep (12)
- pipe? (12)
- pointer (12)
- pointer= (12)
- pos (12)
- pos= (12)
-
post
_ match (12) -
pre
_ match (12) -
prime
_ fasttest? (12) - proc (19)
-
process
_ args (1) -
program
_ name= (12) - puke (1)
- puts (24)
- rake (12)
-
rake
/ rake _ test _ loader (12) -
rake
/ runtest (12) -
rake
/ testtask (12) - rakefile (12)
- read (24)
- readable? (12)
-
readable
_ real? (12) - readlines (12)
- readlink (12)
- ready (12)
- reject (24)
- reject! (12)
- report (1)
- report= (1)
- reset (13)
- resolve (12)
- rest (12)
- rest? (12)
-
rest
_ size (12) - restsize (12)
- result (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby
_ opts (12) -
ruby
_ opts= (12) -
rubygems
/ commands / check _ command (12) -
rubygems
/ commands / install _ command (12) -
rubygems
/ test _ utilities (12) - run (14)
-
run
_ test _ suites (1) - scan (12)
-
scan
_ full (12) -
scan
_ until (12) -
search
_ full (12) - select (12)
-
set
_ backtrace (12) - setgid? (12)
- setuid? (12)
- setup (1)
-
setup
_ argv (1) - shell (6)
- size (24)
- size? (12)
- skip (13)
-
skip
_ until (12) - skips (1)
- skips= (1)
- socket? (12)
-
source
_ location (7) - src (12)
-
start
_ time (1) -
start
_ time= (1) - status (1)
- sticky? (12)
- string (12)
- string= (12)
- sub! (12)
-
sub
_ ext (12) - symlink? (12)
-
synthesize
_ file _ task (12) - tasks (12)
- teardown (1)
- terminate (12)
-
test
/ unit (12) -
test
_ count (1) -
test
_ count= (1) -
test
_ file (12) -
test
_ file= (12) -
test
_ files (12) -
test
_ files= (24) -
test
_ methods (1) -
test
_ order (1) -
test
_ suite _ file (12) -
test
_ suite _ file= (12) -
test
_ suites (1) -
to
_ a (24) -
to
_ ary (12) -
to
_ hash (12) -
to
_ json (24) -
to
_ s (30) -
top
_ level (12) -
top
_ level _ tasks (12) -
tty
_ output= (12) -
unit
_ test (12) - unlink (12)
- unscan (12)
- verbose (12)
- verbose= (12)
- verify (1)
- warn (8)
- warning (12)
- warning= (12)
-
with
_ defaults (12) -
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - write (8)
- yaml (12)
-
yaml
/ store (12) - zero? (12)
- クラス/メソッドの定義 (12)
- プログラム・文・式 (12)
- リテラル (12)
- 手続きオブジェクトの挙動の詳細 (12)
- 演算子式 (12)
検索結果
先頭5件
-
test
/ unit (26198.0) -
ユニットテストを行うためのライブラリです。
...参照してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある......史(2014年版) https://www.clear-code.com/blog/2014/11/6.html
* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html
=== 使い方
Test::Unit は以下のように使います。
まずテスト対象のソース(foo.rb)が必要です......foo"
end
def bar
"foo"
end
end
次にユニットテスト(test_foo.rb)を書きます。テストを実行するメソッド(テストメソッド)の名前は
全て test_ で始まる必要があります。テストメソッドが実行される前には setup......史については以下が詳しくまとまっています。
* Rubyのテスティングフレームワークの歴史(2014年版) https://www.clear-code.com/blog/2014/11/6.html
* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html... -
Kernel
. # test(cmd , file) -> bool | Time | Integer | nil (18129.0) -
単体のファイルでファイルテストを行います。
...me
: ?A
ファイルの最終アクセス時刻を返す -> Time
: ?C
ファイルの inode 変更時刻を返す -> Time
//emlist[例][ruby]{
IO.write("testfile", "test")
test("r", "testfile") # => true
test("s", "testfile") # => 4
test("M", "testfile") # => 2018-03-31 07:38:40 +0900
//}... -
Kernel
. # test(cmd , file1 , file2) -> bool (18124.0) -
2ファイル間のファイルテストを行います。
...ァイル1とファイル2が同一のファイルである
//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result = test(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}
# => =: true
# => <: false
# => >: false
# => -: fals... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15129.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: CommandProcessor # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15129.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15129.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
MiniTest
:: Unit :: TestCase . test _ methods -> Array (12107.0) -
テストメソッドのリストを返します。
...テストメソッドのリストを返します。
MiniTest::Unit::TestCase.test_order の値が :random である場合は
返されるメソッドリストの順番はランダムです。
そうでない場合は、文字コード順にソートされます。... -
MiniTest
:: Unit :: TestCase . test _ order -> Symbol (12101.0) -
テストの実行順序を返します。
テストの実行順序を返します。
デフォルトはランダムです。 -
MiniTest
:: Unit :: TestCase . test _ suites -> Array (12101.0) -
テストクラス名のリストを返します。
テストクラス名のリストを返します。 -
Rake
:: TestTask # test _ files=(list) (9107.0) -
明示的にテスト対象のファイルを指定します。
...明示的にテスト対象のファイルを指定します。
Rake::TestTask#pattern=, Rake::TestTask#test_files= の
両方でテスト対象を指定した場合、両者は一つにまとめて使用されます。
@param list 配列か Rake::FileList のインスタンスを指定します... -
MiniTest
:: Unit # run _ test _ suites(filter = / . / ) -> Array (9101.0) -
全てのテストを実行します。
全てのテストを実行します。
@param filter 実行するテストメソッド名を正規表現で指定します。
@return テストケース数とアサーション数を返します。 -
MiniTest
:: Unit # test _ count -> Fixnum (9101.0) -
テストケース数を返します。
テストケース数を返します。 -
MiniTest
:: Unit # test _ count=(count) (9101.0) -
テストケース数をセットします。
テストケース数をセットします。
@param count 件数を指定します。 -
MiniTest
:: Unit :: TestCase (9012.0) -
テストの基本単位(あるいは「テスト本体」)を表すクラスです。
...トを行うメソッド (テストメソッド) は TestCase のサブクラスの
インスタンスメソッドとして定義されます。
テストメソッドの名前は "test" で始まっていなければなりません。
逆に、"test" で始まっているメソッドは全てテス... -
Gem
:: Specification # test _ file -> String (6117.0) -
Gem::Specification#test_files の単数バージョンです。
...Gem::Specification#test_files の単数バージョンです。... -
Gem
:: Specification # test _ file=(file) (6117.0) -
Gem::Specification#test_files= の単数バージョンです。
...Gem::Specification#test_files= の単数バージョンです。... -
Gem
:: Specification # test _ suite _ file -> String (6117.0) -
この属性は非推奨です。 Gem::Specification#test_files を使用してください。
...この属性は非推奨です。 Gem::Specification#test_files を使用してください。...