Class: BlockDeviceGuard

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

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)


4
5
6
7
8
9
10
11
# File 'lib/mspec/guards/block_device.rb', line 4

def match?
  platform_is_not :freebsd, :windows do
    block = `find /dev /devices -type b 2> /dev/null`
    return !(block.nil? || block.empty?)
  end

  false
end