From 5f73eb553fd083b558fb9553b0c07b6019d0ccee Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 26 Feb 2009 11:43:39 +1100 Subject: Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with semicolons --- spec/integration/indirector/direct_file_server.rb | 6 +++--- spec/unit/provider/mount/parsed.rb | 2 +- spec/unit/type/file/selinux.rb | 24 +++++++++++------------ 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'spec') 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 -- cgit