Skip to content

Instantly share code, notes, and snippets.

# default RubySpec/CI settings for JRuby.
# detect windows platform:
require 'rbconfig'
require 'java'
require 'jruby'
IKVM = java.lang.System.get_property('java.vm.name') =~ /IKVM\.NET/
WINDOWS = Config::CONFIG['host_os'] =~ /mswin/
# requiring rubygems is not needed for JRuby
require 'rubygems' unless defined?(JRUBY_VERSION)
require 'ffi'
# Simple FFI module for some low level system commands (on Windows only!):
# * Turn monitor(s) power off
# * Show the Start menu
module SysCommands
extend FFI::Library
diff --git a/core/array/equal_value_spec.rb b/core/array/equal_value_spec.rb
index c579146..069d2ef 100644
--- a/core/array/equal_value_spec.rb
+++ b/core/array/equal_value_spec.rb
@@ -5,6 +5,13 @@ require File.dirname(__FILE__) + '/shared/eql'
describe "Array#==" do
it_behaves_like :array_eql, :==
+ it 'compares with an equivalent Array-like object using #to_ary' do
+ obj = mock('array-like')
jruby -Ilib D:/work/jruby-dev/jruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/bin/spec spec\java_integration
1)
'A Java primitive Array of type Class ref should be possible to create primitive array from Ruby array' FAILED
expected: class java.lang.String,
got: Java::JavaLang::String (using ==)
D:/work/jruby-dev/jruby/spec/java_integration/types/array_spec.rb:745
2)
'A Java primitive Array of type Class ref should be possible to create primitive array from Ruby array' FAILED
diff --git a/argparser.cpp b/argparser.cpp
index cec153b..f703ce5 100644
--- a/argparser.cpp
+++ b/argparser.cpp
@@ -205,7 +205,7 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
#define CHECK_ARG \
it++; \
- if (it == args.end() || it->at(0) == '-') { \
+ if (it == args.end() || it->length() == 0 || it->at(0) == '-') { \
require 'tempfile'
require 'java' if defined?(JRUBY_VERSION)
require 'test/unit'
require 'fileutils'
class TestTempfilesCleanUp < Test::Unit::TestCase
def setup
@tmpdir = "tmp_#{$$}"
Dir.mkdir @tmpdir rescue nil
jruby -v -rtempfile -e "100_000.times{Tempfile.new('foo')}"
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-03-05 f25167a) (Java HotSpot(TM) Client VM 1.6.0_18) [x86-java]
DeleteOnExitHook.java:34:in `add': java.lang.NullPointerException
from File.java:939:in `deleteOnExit'
from RubyTempfile.java:118:in `initialize'
from org/jruby/RubyTempfile$i_method_0_1$RUBYFRAMEDINVOKER$initialize.gen:-1:in `call'
from CachingCallSite.java:75:in `callBlock'
from CachingCallSite.java:82:in `call'
from RubyClass.java:726:in `newInstance'
from RubyIO.java:865:in `newInstance'
Changes in JRuby Native Launcher since JRuby 1.4.0:
bc8a1a2 Fixed a crash with empty args.
b774fec JRUBY-4611: Stop scanning for options on first bare arg that does not start with '-'
9099209 unixlauncher.cpp: stdlib.h needed for ubuntu linux
3d55608 Good idea on robust specs. I like clearing env ahead of time even better.
5c75f2f Make specs a bit more robust.
73fc430 JRUBY-4603: heed -Xjdkhome on command line over JAVA_HOME
ded0069 Fix argparser regression on windows
020022e Fix new JAVA_HOME spec failure on Windows.
commit 7050bc18a592b779d8fb102ef7ce583902763e3a
Author: Vladimir Sizikov <vsizikov@gmail.com>
Date: Sat Mar 6 13:04:33 2010 +0100
JRUBY-4623: Tempfile does not clean up on GC run
Added unit test as well, but didn't wire it to the index,
since these GC-related issues are not 100% reliably reproducible.
diff --git a/src/org/jruby/RubyTempfile.java b/src/org/jruby/RubyTempfile.java
1)
A Java primitive Array of type Class ref should be possible to create primitive array from Ruby array' FAILED
expected: class java.lang.String,
got: Java::JavaLang::String (using ==)←[0m
D:/work/jruby-dev/jruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/expectations/fail_with.rb:41:in `fail_with'
D:/work/jruby-dev/jruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/matchers/operator_matcher.rb:39:in `fail_with_message'
D:/work/jruby-dev/jruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/matchers/operator_matcher.rb:61:in `__delegate_operator'
D:/work/jruby-dev/jruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/matchers/operator_matcher.rb:51:in `eval_match'
D:/work/jruby-dev/jruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/matchers/operator_matcher.rb:29:in `=='
./spec/java_integration/types/array_spec.rb:745: