mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 22:45:03 +02:00

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
16 lines
348 B
Ruby
16 lines
348 B
Ruby
require 'mspec/guards/guard'
|
|
|
|
class BlockDeviceGuard < SpecGuard
|
|
def match?
|
|
platform_is_not :freebsd, :windows, :opal do
|
|
block = `find /dev /devices -type b 2> /dev/null`
|
|
return !(block.nil? || block.empty?)
|
|
end
|
|
|
|
false
|
|
end
|
|
end
|
|
|
|
def with_block_device(&block)
|
|
BlockDeviceGuard.new.run_if(:with_block_device, &block)
|
|
end
|