commit ee4c6f7c697737aa919b9f90436ab0cc69934b03
Author: Chris Boot <crb@tiger-computing.co.uk>
Date:   Mon Mar 11 15:30:14 2013 +0000

    (#7680) Update tests for changed behaviour after bugfix
    
    A number of tests were broken before the bugfix:
    * incorrectly checking the file mode (missing .should)
    * operating on a non-existent source symlink
    
    Enabled all of the #10315 tests which now pass, some of which needed
    editing due to the expected behaviour now being different for
    links => follow.

--- a/spec/integration/type/file_spec.rb
+++ b/spec/integration/type/file_spec.rb
@@ -272,22 +272,20 @@
 
             describe "that is readable" do
               it "should set the executable bits when creating the destination (#10315)" do
-                pending "bug #10315"
-
                 catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0666, :links => :follow)
                 catalog.apply
 
+                File.should be_directory(path)
                 (get_mode(path) & 07777).should == 0777
               end
 
               it "should set the executable bits when overwriting the destination (#10315)" do
-                pending "bug #10315"
-
                 FileUtils.touch(path)
 
-                catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0666, :links => :follow)
+                catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0666, :links => :follow, :backup => false)
                 catalog.apply
 
+                File.should be_directory(path)
                 (get_mode(path) & 07777).should == 0777
               end
             end
@@ -302,37 +300,41 @@
                 set_mode(0700, target)
               end
 
-              it "should not set executable bits when creating the destination (#10315)" do
-                pending "bug #10315"
-
+              it "should set executable bits when creating the destination (#10315)" do
                 catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0666, :links => :follow)
                 catalog.apply
 
-                (get_mode(path) & 07777).should == 0666
+                File.should be_directory(path)
+                (get_mode(path) & 07777).should == 0777
               end
 
-              it "should not set executable bits when overwriting the destination" do
+              it "should set executable bits when overwriting the destination" do
                 FileUtils.touch(path)
 
-                catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0666, :links => :follow)
+                catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0666, :links => :follow, :backup => false)
                 catalog.apply
 
-                (get_mode(path) & 07777).should == 0666
+                File.should be_directory(path)
+                (get_mode(path) & 07777).should == 0777
               end
             end
           end
 
           describe "to a file" do
-            let(:target) { tmpfile('file_target') }
+            let(:link_target) { tmpfile('file_target') }
 
-            it "should create the file, not a symlink (#2817, #10315)" do
-              pending "bug #2817, #10315"
+            before :each do
+              FileUtils.touch(link_target)
 
+              File.symlink(link_target, link)
+            end
+
+            it "should create the file, not a symlink (#2817, #10315)" do
               catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0600, :links => :follow)
               catalog.apply
 
               File.should be_file(path)
-              (get_mode(path) & 07777) == 0600
+              (get_mode(path) & 07777).should == 0600
             end
 
             it "should overwrite the file" do
@@ -342,7 +344,7 @@
               catalog.apply
 
               File.should be_file(path)
-              (get_mode(path) & 07777) == 0600
+              (get_mode(path) & 07777).should == 0600
             end
           end
 
@@ -364,13 +366,11 @@
 
             describe "when following all links" do
               it "should create the destination and apply executable bits (#10315)" do
-                pending "bug #10315"
-
                 catalog.add_resource described_class.new(:path => path, :source => link, :mode => 0600, :links => :follow)
                 catalog.apply
 
                 File.should be_directory(path)
-                (get_mode(path) & 07777) == 0777
+                (get_mode(path) & 07777).should == 0700
               end
 
               it "should overwrite the destination and apply executable bits" do
@@ -380,7 +380,7 @@
                 catalog.apply
 
                 File.should be_directory(path)
-                (get_mode(path) & 07777) == 0777
+                (get_mode(path) & 0111).should == 0100
               end
             end
           end
