(#17994) Fix wrong (decimal) mode causes sticky bit to be set.

A decimal mode/mask of 755 is clearly wrong; it should have been 0755.
The problem causes the sticky bit (and what not) to be set instead of
what was intended.
Maint: Cleanup spec test

This commit changes the ensure spec to use let blocks and eliminates
stubbing of file resources.
Maint: Remove duplicate tests

Commit 8d212629 duplicated some tests, this commit removes them.
(#17994) Add tests for directory creation

Adds tests to cover when creating directory and mode is specified as
either an octal or symbolic mode.

I was unable to actually create a directory (Dir.mkdir) and then stat it
to verify the mode was set correctly, because on some ruby
implementations, Dir.mkdir ignores special mode bits. On my Mac, for
example, calling Dir.mkdir(path, 01777), results in mode 00777. However,
puppet does the right thing, because it calls `property_fix` on the file
type, which goes through each property and ensures each is in sync.

Since the sticky-bit behavior is system-dependent, I'm setting an
expectation on the Dir object, and that at least detects the bug
reported in #17994.
(#17994) Rework symbolic mode acceptance test

Previously, the acceptance test was only testing that puppet could
modify the mode of an existing file/dir, but not when creating them. As
a result, #17994 went undetected.

This commit adds tests for that as well as adding test coverage for
other cases, such as the user 'a', which is short-hand for 'ugo', the
operation '-', permissions 's' and 't', and the absence of any
permission (o=).

In the process it uncovered a bug, when puppet applies ugo=rwxs to a
file, it results in 07777 instead of 06777. This is filed as #18355

One important thing to note about symbolic modes is that puppet always
uses a umask of 022 when applying the mode to file/directories that it
creates. When only a partial symbolic mode is specified, e.g. u=r, the
resulting mode will be 0444 (file) 0455 (directory), which may not be
what you expect. To ensure you don't accidentally grant more permissions
than intended (such as when setting root's umask to 077), it is
recommended that you fully specify the symbolic mode, e.g. 'u=r,go='

Paired-with: Andy Parker <andy@puppetlabs.com>
Merge branch 'ticket/master/17994-wrong-mode-not-octal'

* ticket/master/17994-wrong-mode-not-octal:
  (#17994) Rework symbolic mode acceptance test
  (#17994) Add tests for directory creation
  Maint: Remove duplicate tests
  Maint: Cleanup spec test
  (#17994) Fix wrong (decimal) mode causes sticky bit to be set.