Sha256: ea17ed11aa4728ed8808cbc839d0c3ecb85793feb4bff80dc1ad605d88d0f96b
Contents?: true
Size: 934 Bytes
Versions: 20
Compression:
Stored size: 934 Bytes
Contents
require 'pathname' require Pathname.new( File.dirname(__FILE__)).join( '../lib/build-tool' ).cleanpath require 'rubygems' require 'logging' require 'stringio' require 'test/unit' Logging.init :debug, :verbose, :trace, :info, :warn, :error include Logging.globally Logging.logger.root.level = :debug Logging.logger.root.clear_appenders() def keep_stdout(&block) begin orig_stream, $stdout = $stdout, StringIO.new block.call($stdout) ensure s, $stdout = $stdout.string, orig_stream s end end def assert_signals( obj, signal, &block ) called = false proc = obj.connect( signal ) { called = true } yield obj.disconnect( signal, &proc ) assert called, "Slot was called" end def assert_output(expected, &block) keep_stdout do |stdout| block.call if expected.is_a?(Regexp) assert_match expected, stdout.string else assert_equal expected.to_s, stdout.string end end end
Version data entries
20 entries across 20 versions & 1 rubygems