Class: RubyMemcheck::TestTask
- Inherits:
-
Rake::TestTask
- Object
- Rake::TestTask
- RubyMemcheck::TestTask
- Defined in:
- lib/ruby_memcheck/test_task.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
Instance Method Summary collapse
-
#initialize(*args) ⇒ TestTask
constructor
A new instance of TestTask.
- #ruby(*args, **options, &block) ⇒ Object
Constructor Details
#initialize(*args) ⇒ TestTask
Returns a new instance of TestTask.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ruby_memcheck/test_task.rb', line 8 def initialize(*args) @configuration = if !args.empty? && args[0].is_a?(Configuration) args.shift else RubyMemcheck.default_configuration end super end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/ruby_memcheck/test_task.rb', line 5 def configuration @configuration end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
6 7 8 |
# File 'lib/ruby_memcheck/test_task.rb', line 6 def reporter @reporter end |
Instance Method Details
#ruby(*args, **options, &block) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ruby_memcheck/test_task.rb', line 19 def ruby(*args, **, &block) command = configuration.command(args) @reporter = TestTaskReporter.new(configuration) @reporter.setup sh(command, **) do |ok, res| @reporter.report_valgrind_errors yield ok, res if block_given? end end |