Skip to content

Commit

Permalink
fixed a bug of be_mounted matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
studio3104 committed May 7, 2013
1 parent 4c33f12 commit fda1b9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/serverspec/backend/exec.rb
Expand Up @@ -140,7 +140,7 @@ def check_mounted(example, path, expected_attr, only_with)
else
match = true
expected_attr.each do |key, val|
match = actual_attr[key] == val
return false if actual_attr[key] != val
end
match
end
Expand Down
12 changes: 12 additions & 0 deletions spec/support/shared_matcher_examples.rb
Expand Up @@ -155,6 +155,10 @@
it { should be_mounted.with( :type => 'ext4', :options => { :mode => 620 } ) }
end

describe valid_mount do
it { should be_mounted.with( :type => 'ext4', :device => '/dev/mapper/VolGroup-lv_root' ) }
end

describe valid_mount do
it { should_not be_mounted.with( :type => 'xfs' ) }
end
Expand All @@ -167,6 +171,14 @@
it { should_not be_mounted.with( :type => 'ext4', :options => { :mode => 600 } ) }
end

describe valid_mount do
it { should_not be_mounted.with( :type => 'xfs', :device => '/dev/mapper/VolGroup-lv_root' ) }
end

describe valid_mount do
it { should_not be_mounted.with( :type => 'ext4', :device => '/dev/mapper/VolGroup-lv_r00t' ) }
end

describe '/etc/thid_is_a_invalid_mount' do
it { should_not be_mounted.with( :type => 'ext4' ) }
end
Expand Down

0 comments on commit fda1b9b

Please sign in to comment.