Class: TTYGuard

Inherits:
SpecGuard show all
Defined in:
lib/extensions/mspec/mspec/guards/tty.rb

Overview

If a spec depends on STDOUT being a tty, use this guard. For specs that may block if run as a background process, see BackgroundGuard.

Instance Attribute Summary

Attributes inherited from SpecGuard

#name, #parameters

Instance Method Summary collapse

Methods inherited from SpecGuard

#===, #add, clear, clear_guards, finish, guards, #implementation?, #initialize, #os?, #platform?, #record, report, #report_key, #reporting?, ruby_version, ruby_version_override, ruby_version_override=, #standard?, #unregister, #windows?, #wordsize?, #yield?

Constructor Details

This class inherits a constructor from SpecGuard

Instance Method Details

#match?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/extensions/mspec/mspec/guards/tty.rb', line 7

def match?
  STDOUT.tty?
end