diff --git a/lib/serverspec/type/file.rb b/lib/serverspec/type/file.rb index 7b6b49d1..1513f3cc 100644 --- a/lib/serverspec/type/file.rb +++ b/lib/serverspec/type/file.rb @@ -10,6 +10,14 @@ def file? @runner.check_file_is_file(@name) end + def block_device? + @runner.check_file_is_block_device(@name) + end + + def character_device? + @runner.check_file_is_character_device(@name) + end + def socket? @runner.check_file_is_socket(@name) end diff --git a/serverspec.gemspec b/serverspec.gemspec index 741d0fed..87ba920e 100644 --- a/serverspec.gemspec +++ b/serverspec.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "rspec", "~> 3.0" spec.add_runtime_dependency "rspec-its" spec.add_runtime_dependency "multi_json" - spec.add_runtime_dependency "specinfra", "~> 2.32" + spec.add_runtime_dependency "specinfra", "~> 2.35" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake", "~> 10.1.1" end diff --git a/spec/type/base/file_spec.rb b/spec/type/base/file_spec.rb index b41d3cb1..58f023b9 100644 --- a/spec/type/base/file_spec.rb +++ b/spec/type/base/file_spec.rb @@ -14,6 +14,14 @@ it { should be_socket } end +describe file('/dev/disk0') do + it { should be_block_device } +end + +describe file('/dev/ttys0') do + it { should be_character_device } +end + describe file('/var/run/pure-ftpd/pure-ftpd.upload.pipe') do it { should be_pipe } end