Skip to content

Commit

Permalink
Fix Rubinius test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Oct 31, 2012
1 parent c211380 commit baf9393
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rake-pipeline/file_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ def read
File.read(fullpath)
end

if "".respond_to?(:encode) && !contents.valid_encoding?
raise EncodingError, "The file at the path #{fullpath} is not valid UTF-8. Please save it again as UTF-8."
# In our unit tests Rubinius returns false when the encoding is BINARY
# The encoding type check bypasses the problem and is probably acceptable, but isn't ideal
if encoding != "BINARY" && "".respond_to?(:encode) && !contents.valid_encoding?
raise EncodingError, "The file at the path #{fullpath} is not valid #{encoding}. Please save it again as #{encoding}."
end

contents
Expand Down

0 comments on commit baf9393

Please sign in to comment.