summaryrefslogtreecommitdiff
path: root/spec/unit/util/docs_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-02-14(maint) Improve Puppet::Util::Docs.scrub's handling of one-linersNick Fagerlund1-0/+9
One-liner handling wasn't behaving as expected. Sometimes one-liners are buffered with extra newlines before and/or after, and in these cases, scrub wasn't catching the leading whitespace. This commit makes it behave as intended, and adds a test showing the intended behavior.
2013-10-03(maint) Refactor Puppet::Util::Docs.scrubNick Fagerlund1-0/+91
It was hard to understand what this method was doing, and once I got it, I noticed it wasn't quite doing what it claimed. (It was cheating -- grabbing the indent of the second line with text and assuming that was the least common indent. This meant you could break it by starting a doc fragment with a line of text, two newlines, and an indented block of example code.) This commit replaces it with something more clear and correct, as well as some comments explaining what we expect it to do. We also trim trailing whitespace, while we're at it; this costs some speed, but should make it even more reliable/useful. We also add tests for scrub in this commit, at spec/unit/util/docs_spec.rb.