るりまサーチ

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

別のキーワード

  1. pp pp
  2. pp seplist
  3. pp comma_breakable
  4. pp object_group
  5. pp singleline_pp

ライブラリ

クラス

キーワード

検索結果

coverage (38216.0)

カバレッジを測定するためのライブラリです。

...(1) require "coverage" で、ライブラリを読み込む。
(2) Coverage.start を実行し、測定を開始する。
(3) require や load で測定対象のファイルを実行する。
(4) Coverage.result や Coverage.peek_result で結果を確認する。

Coverage
.result は、...
..."coverage"
Coverage
.start
load "foo.rb"
p Coverage.result # => {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]}
//}

この Coverage.result["foo.rb"] から得られる配列は各行の実行回数になっています。


=== カバレッジモードの指定

Ruby 2.5 以降では、Coverage...
...件分岐のそれぞれの分岐(branch)の実行された回数を計測します。

//emlist[][ruby]{
require "coverage"
Coverage
.start(branches: true)
load "foo.rb"
pp
Coverage.result
# {"foo.rb"=>
# {:branches=>
# {[:if, 0, 6, 0, 10, 3]=>
# {[:then, 1, 7, 2, 7, 7]=>1, [:else, 2, 9,...

Coverage.start(option = {}) -> nil (35161.0)

カバレッジの測定を開始します。既に実行されていた場合には何も起こりません。 ただし、カバレッジ計測中に測定対象を変更しようとした場合は、RuntimeError となります。

...
詳細は、coverage ライブラリ を参照してください。

//emlist[bool.rb][ruby]{
def bool(obj)
if obj
true
else
false
end
end
//}

//emlist[][ruby]{
require "coverage"

Coverage
.start(:all)
load "bool.rb"
bool(0)
pp
Coverage.result
# {"bool.rb"=>
# {:li...
...:branches=>
# {[:if, 0, 2, 2, 6, 5]=>
# {[:then, 1, 3, 4, 3, 8]=>1, [:else, 2, 5, 4, 5, 9]=>0}},
# :methods=>{[Object, :bool, 1, 0, 7, 3]=>1}}}

Coverage
.start(methods: true)
load "bool.rb"
bool(0)
pp
Coverage.result #=> {"bool.rb"=>{:methods=>{[Object, :bool, 1, 0, 7, 3]=>1}}}
//}...

NEWS for Ruby 2.5.0 (108.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を追加 12746
* Array#prepend を追加 12746

* Data
* 非推奨になりました。C拡張のベースクラスでしたが、Ruby...
...g#casecmp? に文字列でない引数を与えた場合、TypeErrorを発生させずにnilを返すようにしました
13312
* String#start_with? は正規表現を受け取れるようになりました 13712
* String#delete_prefix, String#delete_prefix! を追加 12694
* Stri...
...igDecimal.ver
* BigDecimal#clone と BigDecimal#dup は新しいインスタンスを作らなくなりました。selfを返します。

* coverage
* ブランチカバレッジとメソッドカバレッジの計測をサポートしました 13901
この新機能と一緒にテ...

NEWS for Ruby 3.0.0 (18.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...[[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is...
...nt can take the request headers as a Hash in the second argument when the first argument is a URI. 16686
* Net::SMTP
* Add SNI support.
* Net::SMTP.start arguments are keyword arguments.
* TLS should not check the host name by default.
* OpenStruct
* Initialization is no longer...
...code, tries inferring its type signature, and prints the analysis result in RBS format.
* Though it supports only a subset of the Ruby language yet, we will continuously improve the coverage of language features, analysis performance, and usability.

//emlist[][ruby]{
# test.rb
def foo(x)
if x...