Permalink
Browse files

Fix Rubinius test failures

  • Loading branch information...
1 parent c211380 commit baf93939785cdfe1886cf0ff28717a9120680354 @wagenet wagenet committed Oct 26, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/rake-pipeline/file_wrapper.rb
@@ -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

0 comments on commit baf9393

Please sign in to comment.