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: rvm:
- 1.9.2 - 1.9.2
- 1.9.3 - 1.9.3
- 2.0.0 - 2.0.0
- ruby-head - ruby-head
- rbx-19mode - rbx-19mode
- jruby-19mode
before_install:
- gem update --system
- gem --version
before_script: "sudo apt-get -y install zip unzip" before_script: "sudo apt-get -y install zip unzip"
branches: branches:
only: only:
- master - master
allow_failures:
- rvm: ruby-head

View File

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

View File

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