JRuby support

This commit is contained in:
Alexander Simonov 2013-09-17 20:34:19 +03:00
parent a977cdd2ce
commit 2bd6ebea11
3 changed files with 13 additions and 7 deletions

View File

@ -1,10 +1,17 @@
language: ruby
rvm:
- 1.9.2
- 1.9.3
- 2.0.0
- ruby-head
- rbx-19mode
- jruby-19mode
before_install:
- gem update --system
- gem --version
before_script: "sudo apt-get -y install zip unzip"
branches:
only:
- master
- master
allow_failures:
- rvm: ruby-head

View File

@ -58,7 +58,7 @@ module Zip
end
def to_local_bin
self.map { |_, v| v.to_local_bin }.join
self.map { |_, v| v.to_local_bin.force_encoding('BINARY') }.join
end
alias :to_s :to_local_bin

View File

@ -873,13 +873,12 @@ class ZipEntrySetTest < Test::Unit::TestCase
end
def test_each
# Tested indirectly via each_with_index
# Used each instead each_with_index due the bug in jRuby
count = 0
@zipEntrySet.each_with_index {
|entry, index|
@zipEntrySet.each do |entry|
assert(ZIP_ENTRIES.include?(entry))
count = count.succ
}
count += 1
end
assert_equal(ZIP_ENTRIES.size, count)
end