別のキーワード
種類
ライブラリ
- ビルトイン (1075)
- csv (143)
- delegate (11)
- erb (55)
- fileutils (33)
-
irb
/ inspector (11) - json (22)
-
json
/ add / exception (11) - logger (44)
-
minitest
/ mock (4) -
minitest
/ spec (6) -
minitest
/ unit (70) - mkmf (11)
-
net
/ http (44) -
net
/ imap (11) -
net
/ smtp (22) - objspace (11)
- openssl (11)
- optparse (77)
- pathname (33)
- rake (682)
-
rake
/ loaders / makefile (11) -
rake
/ packagetask (22) -
rake
/ testtask (220) -
rubygems
/ server (11) -
rubygems
/ source _ index (11) -
rubygems
/ source _ info _ cache (66) -
rubygems
/ spec _ fetcher (11) -
rubygems
/ specification (88) -
rubygems
/ validator (11) - set (22)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - strscan (440)
- syslog (22)
-
test
/ unit (2) - tracer (22)
- uri (11)
- win32ole (33)
クラス
-
ARGF
. class (110) - Binding (6)
- CSV (143)
- Dir (11)
- ERB (55)
- Exception (40)
- File (154)
-
Gem
:: Server (11) -
Gem
:: SourceIndex (11) -
Gem
:: SourceInfoCache (66) -
Gem
:: SpecFetcher (11) -
Gem
:: Specification (88) -
Gem
:: Validator (11) - IO (95)
-
IRB
:: Inspector (11) - Logger (44)
- Method (10)
-
MiniTest
:: Mock (3) -
MiniTest
:: Spec (5) -
MiniTest
:: Unit (23) -
MiniTest
:: Unit :: TestCase (13) - Module (5)
-
Net
:: HTTPGenericRequest (44) -
Net
:: IMAP (11) -
Net
:: SMTP (22) -
ObjectSpace
:: WeakMap (11) -
OpenSSL
:: BN (11) - OptionParser (77)
- Pathname (33)
-
Rake
:: Application (99) -
Rake
:: FileList (220) -
Rake
:: FileTask (22) -
Rake
:: InvocationChain (55) -
Rake
:: MakefileLoader (11) -
Rake
:: NameSpace (11) -
Rake
:: PackageTask (22) -
Rake
:: TaskArguments (66) -
Rake
:: TestTask (209) - Set (22)
- Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - String (79)
- StringScanner (429)
- Thread (22)
- TracePoint (22)
- Tracer (22)
-
URI
:: Generic (11) - WIN32OLE (11)
-
WIN32OLE
_ VARIANT (11)
モジュール
- FileTest (292)
- FileUtils (33)
- GC (22)
-
Gem
:: InstallUpdateOptions (11) - JSON (11)
-
JSON
:: Generator :: GeneratorMethods :: String (11) - Kernel (163)
- MiniTest (2)
-
MiniTest
:: Assertions (26) - ObjectSpace (11)
- Rake (33)
-
Rake
:: Cloneable (22) -
Rake
:: TaskManager (143) - Syslog (22)
-
Test
:: Unit (1)
オブジェクト
- ENV (44)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (22)
- == (11)
- Assertion (1)
- Assertions (1)
-
FL
_ TEST (11) - FileTest (11)
-
MINI
_ DIR (1) - MiniTest (1)
- Mock (1)
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) -
PASSTHROUGH
_ EXCEPTIONS (1) - Proc (11)
- RTEST (11)
- Rubyの起動 (3)
- Ruby用語集 (11)
-
SUPPORTS
_ INFO _ SIGNAL (1) - SimpleDelegator (11)
- Skip (1)
- Spec (1)
- StringScanner (11)
- TestCase (1)
- TestTask (11)
- Unit (2)
- VERSION (1)
-
WIN32OLE
_ VARIANT (11) - [] (62)
- []= (11)
-
_ _ name _ _ (1) -
_ assertions (1) -
_ assertions= (1) -
add
_ loader (11) -
add
_ row (11) - after (1)
-
allocation
_ sourcefile (11) - append (22)
- application (11)
- application= (11)
- 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 (11)
- autorun (1)
-
backtrace
_ locations (33) - before (1)
-
beginning
_ of _ line? (11) - binmode (11)
- blockdev? (11)
- body (11)
- body= (11)
-
body
_ stream (11) -
body
_ stream= (11) - bol? (11)
-
caller
_ locations (22) -
capture
_ io (1) - chardev? (11)
- check (11)
-
check
_ until (11) - chomp (11)
- chop (11)
- chown (11)
- chr (11)
- clear (22)
-
clear
_ exclude (11) - clone (22)
- close (22)
- closed? (11)
- concat (11)
-
const
_ source _ location (5) -
create
_ makefile (11) -
create
_ rule (11) - ctime (33)
- current (1)
-
current
_ scope (11) -
datetime
_ format (11) -
datetime
_ format= (11) -
def
_ class (11) -
def
_ inspector (11) -
def
_ module (11) - define (11)
-
define
_ task (11) - delete (33)
-
delete
_ if (11) - desc (11)
- directory? (11)
- dump (11)
- dup (22)
-
each
_ char (22) -
each
_ codepoint (22) - egrep (11)
- empty? (19)
- encoding (11)
- eos? (11)
- errors (1)
- errors= (1)
-
exception
_ details (1) -
excluded
_ from _ list? (11) - executable? (11)
-
executable
_ real? (11) - exist? (22)
- existing (11)
- existing! (11)
- exists? (9)
- expect (1)
- ext (11)
- failures (1)
- failures= (1)
- fdatasync (11)
- fetch (11)
- file? (11)
- filter (33)
-
filter
_ backtrace (1) - flunk (1)
- flush (11)
- fnmatch (11)
- formatter (11)
- getc (11)
- gets (33)
- grpowned? (11)
- gsub (44)
- gsub! (11)
-
has
_ test _ suite? (11) -
has
_ unit _ tests? (11) - hash (11)
- identical? (11)
- import (11)
-
in
_ namespace (11) - inherited (1)
- init (11)
-
inplace
_ mode (11) - inspect (27)
-
install
_ update _ defaults _ str (11) - intern (11)
-
internal
_ encoding (11) - invoke (11)
-
is
_ a? (11) - it (1)
-
kind
_ of? (11) - lambda (17)
-
last
_ comment (11) -
last
_ description (11) -
last
_ description= (11) -
latest
_ cache _ data (11) -
latest
_ cache _ file (11) -
latest
_ gc _ info (22) -
latest
_ specs (33) -
latest
_ system _ cache _ file (22) -
latest
_ user _ cache _ file (22) - lchmod (11)
- lchown (11)
- length (11)
- libs (11)
- libs= (11)
- link (11)
- load (11)
- loader (11)
- loader= (11)
- location (1)
- lookup (11)
- mask (11)
- mask= (11)
- match? (11)
- matched (11)
- matched? (11)
-
matched
_ size (11) - member? (11)
-
minitest
/ autorun (11) -
minitest
/ mock (11) -
minitest
/ spec (11) -
minitest
/ unit (11) - mkdir (11)
- move (11)
- mtime (11)
-
mu
_ pp (1) - mv (11)
- name (22)
- name= (11)
- names (11)
- needed? (11)
-
net
/ smtp (11) - new (115)
-
new
_ scope (11) - on (22)
-
on
_ head (11) -
on
_ tail (11) - open (66)
-
original
_ dir (22) - output= (1)
- owned? (11)
-
package
_ files (11) -
package
_ files= (11) - parse (22)
- parse! (11)
- pass (1)
- passed? (1)
- path (11)
- pathmap (11)
- pattern (11)
- pattern= (11)
- peek (11)
- peep (11)
- pipe? (11)
- pointer (11)
- pointer= (11)
- pos (11)
- pos= (11)
-
post
_ match (11) -
pre
_ match (11) -
prime
_ fasttest? (11) - proc (18)
-
process
_ args (1) -
program
_ name= (11) - puke (1)
- puts (22)
- rake (11)
-
rake
/ rake _ test _ loader (11) -
rake
/ runtest (11) -
rake
/ testtask (11) - rakefile (11)
- read (22)
- readable? (11)
-
readable
_ real? (11) - readlines (11)
- readlink (11)
- ready (11)
- reject (22)
- reject! (11)
- report (1)
- report= (1)
- reset (12)
- resolve (11)
- rest (11)
- rest? (11)
-
rest
_ size (11) - restsize (11)
- result (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby
_ opts (11) -
ruby
_ opts= (11) -
rubygems
/ commands / check _ command (11) -
rubygems
/ commands / install _ command (11) -
rubygems
/ test _ utilities (11) - run (13)
-
run
_ test _ suites (1) - scan (11)
-
scan
_ full (11) -
scan
_ until (11) -
search
_ full (11) - select (11)
-
set
_ backtrace (11) - setgid? (11)
- setuid? (11)
- setup (1)
-
setup
_ argv (1) - shell (6)
- size (22)
- size? (11)
- skip (12)
-
skip
_ until (11) - skips (1)
- skips= (1)
- socket? (11)
-
source
_ location (6) - src (11)
-
start
_ time (1) -
start
_ time= (1) - status (1)
- sticky? (11)
- string (11)
- string= (11)
- sub! (11)
-
sub
_ ext (11) - symlink? (11)
-
synthesize
_ file _ task (11) - tasks (11)
- teardown (1)
- terminate (11)
-
test
/ unit (11) -
test
_ count (1) -
test
_ count= (1) -
test
_ file (11) -
test
_ file= (11) -
test
_ files (11) -
test
_ files= (22) -
test
_ methods (1) -
test
_ order (1) -
test
_ suite _ file (11) -
test
_ suite _ file= (11) -
test
_ suites (1) -
to
_ a (22) -
to
_ ary (11) -
to
_ hash (11) -
to
_ json (22) -
to
_ s (27) -
top
_ level (11) -
top
_ level _ tasks (11) -
tty
_ output= (11) -
unit
_ test (11) - unlink (11)
- unscan (11)
- verbose (11)
- verbose= (11)
- verify (1)
- warn (7)
- warning (11)
- warning= (11)
-
with
_ defaults (11) -
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (7)
- yaml (11)
-
yaml
/ store (11) - zero? (11)
- クラス/メソッドの定義 (11)
- プログラム・文・式 (11)
- リテラル (11)
- 手続きオブジェクトの挙動の詳細 (11)
- 演算子式 (11)
検索結果
先頭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 を使用してください。...