spec/unit/resource/file_spec.rb in chef-10.14.0.beta.2 vs spec/unit/resource/file_spec.rb in chef-10.14.0.beta.3

- old
+ new

@@ -83,18 +83,25 @@ @resource.group("wheel") @resource.mode("0644") @resource.checksum("1" * 64) end - it "describes its state" do - state = @resource.state - state[:owner].should == "root" - state[:group].should == "wheel" - state[:mode].should == "0644" - state[:checksum].should == "1" * 64 + context "on unix", :unix_only do + it "describes its state" do + state = @resource.state + state[:owner].should == "root" + state[:group].should == "wheel" + state[:mode].should == "0644" + state[:checksum].should == "1" * 64 + end end + context "on windows", :windows_only do + # according to Chef::Resource::File, windows state attributes are rights + deny_rights + pending "it describes its state" + end + it "returns the file path as its identity" do @resource.identity.should == "/tmp/foo.txt" end end @@ -104,10 +111,10 @@ @resource.rights :read, "Everyone" @resource.rights :full_control, "DOMAIN\User" end it "describes its state including windows ACL attributes" do state = @resource.state - state.rights.should == [ {:permissions => :read, :principals => "Everyone"}, + state[:rights].should == [ {:permissions => :read, :principals => "Everyone"}, {:permissions => :full_control, :principals => "DOMAIN\User"} ] end end end