るりまサーチ

最速Rubyリファレンスマニュアル検索!
1696件ヒット [1-100件を表示] (0.034秒)
トップページ > クエリ:end[x] > クエリ:test[x]

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Kernel.#test(cmd, file) -> bool | Time | Integer | nil (18130.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 (18130.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
# => -: false...

Shell#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (15135.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 (15135.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 (15135.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::Assertions#assert_send(array, message = nil) -> true (9100.0)

引数から、式を取り出して評価した結果が真の場合、検査にパスしたことになります。

...します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。

@raise MiniTest::Assertion 取り出した式が偽を返す場合に発生します。

例:
assert_send([%w[foo bar baz], :include?, 'baz'])...

test/unit (6246.0)

ユニットテストを行うためのライブラリです。

...参照してください。

* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/

なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある...
...of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html

=== 使い方

Test
::Unit は以下のように使います。

まずテスト対象のソース(foo.rb)が必要です。

class Foo
def foo
"foo"
end

def bar
"foo"
end
...
...end

次にユニットテスト(test_foo.rb)を書きます。テストを実行するメソッド(テストメソッド)の名前は
全て test_ で始まる必要があります。テストメソッドが実行される前には setup メソッドが必ず
呼ばれます。実行されたあ...

minitest/unit (6156.0)

ユニットテストを行うためのライブラリです。

...ラリです。

=== 使い方

minitest/unit は以下のように使います。

テスト対象のソース (foo.rb) を用意します。

class Foo
def foo
"foo"
end

def bar
"foo"
end

end


次にユニットテスト (test_foo.rb) を書きます。
テストを...
...) の名前はすべて "test" で始まる必要があります。
テストメソッドが実行される前には setup メソッドが必ず実行されます。
テストメソッドが実行された後には teardown メソッドが必ず実行されます。

minitest/unit を Kernel.#requir...
...'minitest/unit'
require 'foo'

MiniTest::Unit.autorun

class TestFoo < MiniTest::Unit::TestCase
def setup
@foo = Foo.new
end

# teardown はあまり使わない
def teardown
@foo = nil
end


def test_foo
assert_equal "foo", @foo.foo
end
...

Rake::InvocationChain#append(task_name) -> Rake::InvocationChain (6118.0)

与えられたタスク名を追加して新しい Rake::InvocationChain を返します。

...た場合に発生します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.append("task_b") # => LL("task_b", "task_a")
end

//}...

Rake::InvocationChain.append(task_name, chain) -> Rake::InvocationChain (6118.0)

与えられたタスク名を第二引数の Rake::InvocationChain に追加します。

...e::InvocationChain のインスタンスを指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
chain = Rake::InvocationChain::EMPTY
b = Rake::InvocationChain.append("task_a", chain)
b.to_s # => "TOP => task_a"
end

//}...

絞り込み条件を変える

Rake::TestTask (6078.0)

ユニットテストを実行するためのタスクを作成するクラスです。

...:TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test*.rb']
t.verbose = true
end


以下に test ターゲットの使用例を示します。

例:
rake test # run tests normally
rake test TEST=just_one_file.rb # run just one test...
...file.
rake test TESTOPTS="-v" # run in verbose mode
rake test TESTOPTS="--runner=fox" # use the fox test runner...

1.6.8から1.8.0への変更点(まとめ) (882.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...よくわかりません(^^;

class << Object
p [self.id, self]
class << self
p [self.id, self]
end

end

=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]
[537742484, Class]
=> ruby 1.7.3 (2002-09...
...class << Object.new
class << self.superclass
p [self.id, self]
end

class << self
p [self.superclass.id, self.superclass]
end

end

=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]
[5...
...# # derived from sample/test.rb
# a = *[]; p a # special case
# def f; yield; end; f {|a| p a} # add (warning)
# def r; return; end; a = r(); p a
# a = nil; p a
# def f; yield nil; end; f {|a| p a}
# def r; return nil; end; a = r(); p a
#...

クラス/メソッドの定義 (576.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...* defined

===[a:class] クラス定義

//emlist[例][ruby]{
class Foo < Super
def test
# ...
end

# ...
end

//}

文法:

class 識別子 [`<' superclass ]
式..
end


文法:

class 識別子 [`<' superclass ]
式..
[resc...
...ue [error_type,..] [=> evar] [then]
式..]..
[else
式..]
[ensure
式..]
end


クラスを定義します。クラス名はアルファベットの大文字で始まる識別子です。

rescue/ensure 節を指定し、例外処理...
.../emlist[][ruby]{
class Foo < Array
def foo
end

end


# 定義を追加(スーパークラス Array を明示的に指定しても同じ)
class Foo
def bar
end

end


# 間違ったスーパークラスを指定するとエラー
class Foo < String
end

# => superclass mismatch for class Foo (Typ...
<< 1 2 3 ... > >>