From 452fbda9af1bf8b4dfa1b4955ecb78f9790d8161 Mon Sep 17 00:00:00 2001 From: "Tim D. Smith" Date: Mon, 27 Jun 2016 17:58:32 -0700 Subject: [PATCH] Document Step --- Library/Homebrew/dev-cmd/test-bot.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb index 78d90158df..745d66a339 100644 --- a/Library/Homebrew/dev-cmd/test-bot.rb +++ b/Library/Homebrew/dev-cmd/test-bot.rb @@ -93,9 +93,17 @@ module Homebrew end end + # Wraps command invocations. Instantiated by Test#test. + # Handles logging and pretty-printing. class Step attr_reader :command, :name, :status, :output, :time + # Instantiates a Step object. + # @param test [Test] The parent Test object + # @param command [Array] Command to execute and arguments + # @param options [Hash] Recognized options are: + # :puts_output_on_success + # :repository def initialize(test, command, options = {}) @test = test @category = test.category @@ -152,6 +160,9 @@ module Homebrew @output && !@output.empty? end + # The execution time of the task. + # Precondition: Step#run has been called. + # @return [Float] execution time in seconds def time @end_time - @start_time end