30件ヒット
[1-30件を表示]
(0.010秒)
別のキーワード
種類
- クラス (13)
- 文書 (12)
- インスタンスメソッド (4)
- ライブラリ (1)
ライブラリ
- ビルトイン (12)
-
minitest
/ unit (5)
クラス
-
MiniTest
:: Unit (3)
モジュール
キーワード
- Location (12)
- Skip (1)
-
minitest
/ unit (1) - puke (1)
-
ruby 1
. 8 . 4 feature (12) - skips (1)
- skips= (1)
検索結果
先頭5件
-
MiniTest
:: Assertions # skip(message = nil , backtrace = caller) (21107.0) -
このメソッドを呼び出したテストメソッドをスキップします。
...ます。
@param message メッセージを指定します。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@raise MiniTest::Skip 必ず発生します。
@see Kernel.#raise... -
MiniTest
:: Unit # skips -> Fixnum (9100.0) -
実行しなかったテストケース数を返します。
実行しなかったテストケース数を返します。 -
MiniTest
:: Unit # skips=(count) (9100.0) -
実行しなかったテストケース数をセットします。
実行しなかったテストケース数をセットします。
@param count 件数を指定します。 -
MiniTest
:: Skip (9016.0) -
MiniTest::Assertions#skip を呼び出した時に発生する例外です。
...MiniTest::Assertions#skip を呼び出した時に発生する例外です。... -
minitest
/ unit (6018.0) -
ユニットテストを行うためのライブラリです。
...ユニットテストを行うためのライブラリです。
=== 使い方
minitest/unit は以下のように使います。
テスト対象のソース (foo.rb) を用意します。
class Foo
def foo
"foo"
end
def bar
"foo"
end
end
次にユニットテス......teardown メソッドが必ず実行されます。
minitest/unit を Kernel.#require しただけではテストが自動実行されません。
require 'minitest/unit'
require 'foo'
MiniTest::Unit.autorun
class TestFoo < MiniTest::Unit::TestCase
def setup
@foo = Foo.new......0 seconds.
1) Failure:
test_bar(TestFoo) [test_foo.rb:20]:
Expected "bar", not "foo".
2 tests, 2 assertions, 1 failures, 0 errors, 0 skips
test_bar だけテストしたい場合は以下のようなオプションを与えます。
$ ruby test_foo.rb -n test_bar
Loaded suite t... -
MiniTest
:: Unit # puke(klass , method _ name , exception) -> String (3006.0) -
テストメソッドの実行結果が成功以外の場合に、その種類と理由を記録します。
...ストクラスを指定します。
@param method_name テストメソッドの名前を指定します。
@param exception 例外クラスを指定します。
@return 与えられた例外クラスによって "Skip", "Failure", "Error" の
いずれかの頭文字を返します。... -
Thread
:: Backtrace :: Location (66.0) -
Ruby のフレームを表すクラスです。
...。
Kernel.#caller_locations から生成されます。
//emlist[例1][ruby]{
# caller_locations.rb
def a(skip)
caller_locations(skip)
end
def b(skip)
a(skip)
end
def c(skip)
b(skip)
end
c(0..2).map do |call|
puts call.to_s
end
//}
例1の実行結果:
caller_locations.rb:2:in `a'......rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
//}
例2の実行結果:
init.rb:4:in `initialize'
init.rb:8:in `new'
init.rb:8:in `<main>'
=== 参考
* Ruby VM ア... -
ruby 1
. 8 . 4 feature (24.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...* ((<ruby 1.8.4 feature/"Ruby/Tk">))
* ((<ruby 1.8.4 feature/REXML [compat]>))
* ((<ruby 1.8.4 feature/TCPSocket#initialize [bug]>))
* ((<ruby 1.8.4 feature/TCPServer#initialize [bug]>))
* ((<ruby 1.8.4 feature/"optparse">))
* ((<ruby 1.8.4 feature/"find">))
* ((<ruby 1.8.4 feature/Ic......しました。((<ruby-dev:27964>))
module Foo
def initialize
super
end
end
class Bar
include Foo
def initialize
Foo.instance_method(:initialize).bind(self).call
end
end
Bar.new......e.basename [change]
: File.dirname [change]
#Tue Nov 22 14:46:57 2005 NAKAMURA Usaku <usa@ruby-lang.org>
#
# * file.c (rb_file_s_basename): skip slashes just after UNC top slashes.
#
# * test/ruby/test_path.rb (test_dirname, test_basename): follow new
# spec. and add new tests...