Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Coverage.setup

Coverage.setup => nil
Coverage.setup(:all) => nil
Coverage.setup(lines: bool, branches: bool, methods: bool, eval: bool) => nil
Coverage.setup(oneshot_lines: true) => nil

Set up the coverage measurement.

Note that this method does not start the measurement itself. Use Coverage.resume to start the measurement.

You may want to use Coverage.start to setup and then start the measurement.

See also .running? .start .resume .state also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1