|
77 | 77 | lambda { @resource.group "root*goo" }.should raise_error(ArgumentError) |
78 | 78 | end |
79 | 79 |
|
80 | | - it "should accept a valid unix file mode" do |
| 80 | + it "should accept a unix file mode in string form as an octal number" do |
| 81 | + lambda { @resource.mode "0" }.should_not raise_error(ArgumentError) |
| 82 | + lambda { @resource.mode "0000" }.should_not raise_error(ArgumentError) |
| 83 | + lambda { @resource.mode "0111" }.should_not raise_error(ArgumentError) |
| 84 | + lambda { @resource.mode "0444" }.should_not raise_error(ArgumentError) |
| 85 | + lambda { @resource.mode "07777" }.should_not raise_error(ArgumentError) |
| 86 | + |
| 87 | + lambda { @resource.mode "0" }.should_not raise_error(ArgumentError) |
| 88 | + lambda { @resource.mode "111" }.should_not raise_error(ArgumentError) |
| 89 | + lambda { @resource.mode "444" }.should_not raise_error(ArgumentError) |
| 90 | + lambda { @resource.mode "7777" }.should_not raise_error(ArgumentError) |
| 91 | + |
| 92 | + lambda { @resource.mode "-01" }.should raise_error(ArgumentError) |
| 93 | + lambda { @resource.mode "010000" }.should raise_error(ArgumentError) |
| 94 | + lambda { @resource.mode "-1" }.should raise_error(ArgumentError) |
| 95 | + lambda { @resource.mode "10000" }.should raise_error(ArgumentError) |
| 96 | + |
| 97 | + lambda { @resource.mode "07778" }.should raise_error(ArgumentError) |
| 98 | + lambda { @resource.mode "7778" }.should raise_error(ArgumentError) |
| 99 | + lambda { @resource.mode "4095" }.should raise_error(ArgumentError) |
| 100 | + |
| 101 | + lambda { @resource.mode "0foo1234" }.should raise_error(ArgumentError) |
| 102 | + lambda { @resource.mode "foo1234" }.should raise_error(ArgumentError) |
| 103 | + end |
| 104 | + |
| 105 | + it "should accept a unix file mode in numeric form as a ruby-interpreted integer" do |
| 106 | + lambda { @resource.mode 0 }.should_not raise_error(ArgumentError) |
| 107 | + lambda { @resource.mode 0000 }.should_not raise_error(ArgumentError) |
| 108 | + lambda { @resource.mode 0111 }.should_not raise_error(ArgumentError) |
81 | 109 | lambda { @resource.mode 0444 }.should_not raise_error(ArgumentError) |
82 | | - @resource.mode.should eql(0444) |
83 | | - lambda { @resource.mode 444 }.should_not raise_error(ArgumentError) |
84 | | - lambda { @resource.mode 4 }.should raise_error(ArgumentError) |
| 110 | + lambda { @resource.mode 07777 }.should_not raise_error(ArgumentError) |
| 111 | + |
| 112 | + lambda { @resource.mode 0 }.should_not raise_error(ArgumentError) |
| 113 | + lambda { @resource.mode 73 }.should_not raise_error(ArgumentError) |
| 114 | + lambda { @resource.mode 292 }.should_not raise_error(ArgumentError) |
| 115 | + lambda { @resource.mode 4095 }.should_not raise_error(ArgumentError) |
| 116 | + |
| 117 | + lambda { @resource.mode -01 }.should raise_error(ArgumentError) |
| 118 | + lambda { @resource.mode 010000 }.should raise_error(ArgumentError) |
| 119 | + lambda { @resource.mode -1 }.should raise_error(ArgumentError) |
| 120 | + lambda { @resource.mode 4096 }.should raise_error(ArgumentError) |
85 | 121 | end |
86 | 122 |
|
87 | 123 | it "should accept a user name or id for owner" do |
|
0 commit comments