summaryrefslogtreecommitdiffstats
path: root/test
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 /test
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 'test')
-rwxr-xr-xtest/language/snippets.rb3
-rwxr-xr-xtest/ral/type/file.rb2
2 files changed, 4 insertions, 1 deletions
diff --git a/test/language/snippets.rb b/test/language/snippets.rb
index 51c5e23fe..a10e8e870 100755
--- a/test/language/snippets.rb
+++ b/test/language/snippets.rb
@@ -37,6 +37,9 @@ class TestSnippets < Test::Unit::TestCase
end
def assert_mode_equal(mode, path)
+ if mode.is_a? Integer
+ mode = mode.to_s(8)
+ end
unless file = @catalog.resource(:file, path)
raise "Could not find file #{path}"
end
diff --git a/test/ral/type/file.rb b/test/ral/type/file.rb
index 6322529cf..386c3ca1b 100755
--- a/test/ral/type/file.rb
+++ b/test/ral/type/file.rb
@@ -612,7 +612,7 @@ class TestFile < Test::Unit::TestCase
:mode => "0777"
)
- assert_equal(0777, file.should(:mode), "Mode did not get set correctly")
+ assert_equal("777", file.should(:mode), "Mode did not get set correctly")
assert_apply(file)
assert_equal(0777, File.stat(path).mode & 007777, "file mode is incorrect")
File.unlink(path)