summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2009-02-26 11:43:39 +1100
committerJames Turnbull <james@lovedthanlost.net>2009-02-26 11:43:39 +1100
commit5f73eb553fd083b558fb9553b0c07b6019d0ccee (patch)
tree123ef2a9c7b8aa4e1cd52e6b98d0b3c53d626de6 /spec
parente40aea3c655e698d26c29370227b52c489e6db2b (diff)
downloadpuppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.gz
puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.xz
puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.zip
Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with semicolons
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/indirector/direct_file_server.rb6
-rwxr-xr-xspec/unit/provider/mount/parsed.rb2
-rw-r--r--spec/unit/type/file/selinux.rb24
3 files changed, 16 insertions, 16 deletions
diff --git a/spec/integration/indirector/direct_file_server.rb b/spec/integration/indirector/direct_file_server.rb
index 7280cda98..9843c7e65 100755
--- a/spec/integration/indirector/direct_file_server.rb
+++ b/spec/integration/indirector/direct_file_server.rb
@@ -62,9 +62,9 @@ describe Puppet::Indirector::DirectFileServer, " when interacting with FileServi
it "should return instances capable of returning their content" do
@terminus.search(@request).each do |instance|
case instance.full_path
- when /one/: instance.content.should == "one content"
- when /two/: instance.content.should == "two content"
- when @path:
+ when /one/; instance.content.should == "one content"
+ when /two/; instance.content.should == "two content"
+ when @path
else
raise "No valid key for %s" % instance.path.inspect
end
diff --git a/spec/unit/provider/mount/parsed.rb b/spec/unit/provider/mount/parsed.rb
index 8a7b52531..d2c992f33 100755
--- a/spec/unit/provider/mount/parsed.rb
+++ b/spec/unit/provider/mount/parsed.rb
@@ -102,7 +102,7 @@ describe provider_class do
# LAK:FIXME I can't mock Facter because this test happens at parse-time.
it "should default to /etc/vfstab on Solaris and /etc/fstab everywhere else" do
should = case Facter.value(:operatingsystem)
- when "Solaris": "/etc/vfstab"
+ when "Solaris"; "/etc/vfstab"
else
"/etc/fstab"
end
diff --git a/spec/unit/type/file/selinux.rb b/spec/unit/type/file/selinux.rb
index bf3315bf9..be58e636a 100644
--- a/spec/unit/type/file/selinux.rb
+++ b/spec/unit/type/file/selinux.rb
@@ -29,10 +29,10 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f
@resource.expects(:stat).returns stat
@sel.expects(:get_selinux_current_context).with("/my/file").returns "user_u:role_r:type_t:s0"
expectedresult = case param
- when :seluser then "user_u"
- when :selrole then "role_r"
- when :seltype then "type_t"
- when :selrange then "s0"
+ when :seluser; "user_u"
+ when :selrole; "role_r"
+ when :seltype; "type_t"
+ when :selrange; "s0"
end
@sel.retrieve.should == expectedresult
end
@@ -42,10 +42,10 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f
@resource.expects(:stat).returns stat
@sel.expects(:get_selinux_current_context).with("/my/file").returns "user_u:role_r:type_t"
expectedresult = case param
- when :seluser then "user_u"
- when :selrole then "role_r"
- when :seltype then "type_t"
- when :selrange then nil
+ when :seluser; "user_u"
+ when :selrole; "role_r"
+ when :seltype; "type_t"
+ when :selrange; nil
end
@sel.retrieve.should == expectedresult
end
@@ -59,10 +59,10 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f
@sel.stubs(:debug)
@sel.expects(:get_selinux_default_context).with("/my/file").returns "user_u:role_r:type_t:s0"
expectedresult = case param
- when :seluser then "user_u"
- when :selrole then "role_r"
- when :seltype then "type_t"
- when :selrange then "s0"
+ when :seluser; "user_u"
+ when :selrole; "role_r"
+ when :seltype; "type_t"
+ when :selrange; "s0"
end
@sel.default.must == expectedresult
end