Module: Gauge

Defined in:
lib/util.rb,
lib/log.rb,
lib/table.rb,
lib/api.pb.rb,
lib/spec.pb.rb,
lib/executor.rb,
lib/connector.rb,
lib/datastore.rb,
lib/code_parser.rb,
lib/messages.pb.rb,
lib/method_cache.rb,
lib/configuration.rb,
lib/gauge_runtime.rb,
lib/static_loader.rb,
lib/gauge_messages.rb,
lib/message_processor.rb,
lib/processors/execution_handler.rb,
lib/processors/cache_file_processor.rb,
lib/processors/kill_request_processor.rb,
lib/processors/datastore_init_processor.rb,
lib/processors/execution_hook_processors.rb,
lib/processors/step_name_request_processor.rb,
lib/processors/step_names_request_processor.rb,
lib/processors/stub_implementation_processor.rb,
lib/processors/execute_step_request_processor.rb,
lib/processors/refactor_step_request_processor.rb,
lib/processors/step_positions_request_processor.rb,
lib/processors/step_validation_request_processor.rb,
lib/processors/implementation_file_list_processor.rb

Overview

You should have received a copy of the GNU General Public License along with Gauge-Ruby. If not, see <www.gnu.org/licenses/>.

Defined Under Namespace

Modules: Connector, Executor, GaugeLog, Messages, Processors, Runtime, StaticLoader Classes: CodeParser, Configuration, DataStore, DataStoreFactory, DebugOptions, GaugeMessages, MessageProcessor, MethodCache, Row, Table, Util

Constant Summary collapse

Log =
Logger.new(STDOUT)

Class Method Summary collapse

Class Method Details

.configure(&block) ⇒ Object

Custom configuration for Gauge

  • Lets you configure modules that need to be included at runtime.

  • Lets you define a custom screengrabber, which will be invoked to capture screenshot on failure.

Examples:

# Given there are two modules defined
module Foo 
end

module Bar
end

# Gauge can be configured to include these modules at runtime.

Gauge.configure do |config|
  config.include Foo, Bar
end
# Default behaviour is to capture the active desktop at the point of failure.
# The implementation should return a byte array of the image.
Gauge.configure do |config|
  config.screengrabber =  -> { return File.binread("/path/to/screenshot")}
end


47
48
49
# File 'lib/configuration.rb', line 47

def configure(&block)
  Configuration.instance.instance_eval &block
end

.write_message(message) ⇒ Object

Custom Messages for Gauge Lets you send custom execution messages to Gauge which are printed in reports.

Examples:

Gauge.write_message 'The answer is 42.'


27
28
29
# File 'lib/gauge_messages.rb', line 27

def write_message(message)
  GaugeMessages.instance.write(message)
end