(#22129) force explicit file content to be treated as a bytestring#1831
(#22129) force explicit file content to be treated as a bytestring#1831adrienthebo merged 2 commits intopuppetlabs:masterfrom
Conversation
This replicates the implicit behavior in Ruby-1.8.7, and avoids chasing down every location where a value is passed to `should=` and setting the encoding there.
|
CLA signed by all contributors. |
|
@Sharpie is our resident expert on Unicode support inside of Puppet, could you look this over? |
spec/unit/type/file/content_spec.rb
Outdated
There was a problem hiding this comment.
I think this should be written as it "should ...", :if => "".respond_to?(:encode) do. That way it is still known by rspec even when it isn't run. https://www.relishapp.com/rspec/rspec-core/docs/filtering/if-and-unless
There was a problem hiding this comment.
Is this invoking Puppet::Parameter#value= ? If so, why would this be done here instead of in the munge hook?
There was a problem hiding this comment.
No, it's a local variable, passed by reference to super.
|
Any other concerns here? |
There was a problem hiding this comment.
I traced down the travis-ci failures to this line; it looks like Ruby 2.0 was changing the encoding of the asserted string on this line. I'll fix this up locally and merge.
|
I've made a couple of fixups to this locally and it's ready to merge, but the build is currently failing (https://jenkins.puppetlabs.com/view/Puppet%20FOSS/view/Master/job/Puppet%20Specs%20(master)/1318/). As soon as the build is passing then this can be merged. Thanks again for the contribution! |
(#22129) force explicit file content to be treated as a bytestring
|
Wait. Shoot. I didn't mean to merge that one. I was going to merge my local fixup one. Well, there goes the build. :| |
|
Merged the spec fixture fix in 9a24fa8. This should be released in 3.4.0, thanks again! |
This replicates the implicit behavior in Ruby-1.8.7, and avoids chasing
down every location where a value is passed to
should=and setting theencoding there.
I don't have an environment with Ruby-2.0 and puppet set up to run the new spec, but from inspection, and testing the code manually, I think it will work.