summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-10-18 16:35:32 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-12-08 14:57:50 -0800
commit3e5927773c1dc7bc6e9af922fef09149d1599ef6 (patch)
treee6d265bbffe230253a97f6c7e92442fa61296499 /spec/unit
parent93526712755d5c30e020754a6f759b204921f423 (diff)
downloadpuppet-3e5927773c1dc7bc6e9af922fef09149d1599ef6.tar.gz
puppet-3e5927773c1dc7bc6e9af922fef09149d1599ef6.tar.xz
puppet-3e5927773c1dc7bc6e9af922fef09149d1599ef6.zip
Fix #1757 Change file mode representation to octal
This patch changes the internal representation of a file's mode to a string instead of an integer. This simplifies the problem of displaying the value consistently throughout all of puppet.
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/transaction/resource_harness_spec.rb6
-rwxr-xr-xspec/unit/type/file/source_spec.rb4
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/transaction/resource_harness_spec.rb b/spec/unit/transaction/resource_harness_spec.rb
index 255481ae4..4611409d5 100755
--- a/spec/unit/transaction/resource_harness_spec.rb
+++ b/spec/unit/transaction/resource_harness_spec.rb
@@ -46,7 +46,7 @@ describe Puppet::Transaction::ResourceHarness do
@harness.cache(@resource, :mode, "755")
@harness.copy_audited_parameters(@resource, {}).should == [:mode]
- @resource[:mode].should == 0755
+ @resource[:mode].should == "755"
end
it "should cache and log the current value if no cached values are present" do
@@ -169,7 +169,7 @@ describe Puppet::Transaction::ResourceHarness do
@resource[:audit] = :mode
@harness.cache(@resource, :mode, "755")
@harness.changes_to_perform(@status, @resource)
- @resource[:mode].should == 0755
+ @resource[:mode].should == "755"
end
it "should mark changes created as a result of auditing as auditing changes" do
@@ -242,7 +242,7 @@ describe Puppet::Transaction::ResourceHarness do
@resource[:ensure] = :present
@resource[:mode] = "755"
@current_state[:ensure] = :present
- @current_state[:mode] = 0755
+ @current_state[:mode] = "755"
@harness.changes_to_perform(@status, @resource).should == []
end
end
diff --git a/spec/unit/type/file/source_spec.rb b/spec/unit/type/file/source_spec.rb
index a45a1f74e..522ae1f0e 100755
--- a/spec/unit/type/file/source_spec.rb
+++ b/spec/unit/type/file/source_spec.rb
@@ -154,7 +154,7 @@ describe Puppet::Type.type(:file).attrclass(:source) do
@resource[:owner].must == 100
@resource[:group].must == 200
- @resource[:mode].must == 123
+ @resource[:mode].must == "173"
# Metadata calls it checksum, we call it content.
@resource[:content].must == @metadata.checksum
@@ -170,7 +170,7 @@ describe Puppet::Type.type(:file).attrclass(:source) do
@resource[:owner].must == 1
@resource[:group].must == 2
- @resource[:mode].must == 3
+ @resource[:mode].must == "3"
@resource[:content].should_not == @metadata.checksum
end