Skip to content

Commit 05d79cb

Browse files
committed
Merge branch 'master' into truffle-head
Conflicts: truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
2 parents a228a03 + 3855ace commit 05d79cb

File tree

589 files changed

+5781
-9464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

589 files changed

+5781
-9464
lines changed

core/src/main/java/org/jruby/RubyGlobal.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public static void createGlobals(ThreadContext context, Ruby runtime) {
124124
runtime.defineGlobalConstant("RUBY_PATCHLEVEL", patchlevel);
125125
runtime.defineGlobalConstant("RUBY_RELEASE_DATE", release);
126126
runtime.defineGlobalConstant("RUBY_PLATFORM", platform);
127-
runtime.defineGlobalConstant("RUBY_ENGINE", engine);
128127

129128
IRubyObject description = runtime.newString(OutputStrings.getVersionString()).freeze(context);
130129
runtime.defineGlobalConstant("RUBY_DESCRIPTION", description);
@@ -142,6 +141,8 @@ public static void createGlobals(ThreadContext context, Ruby runtime) {
142141

143142
// needs to be a fixnum, but our revision is a sha1 hash from git
144143
runtime.defineGlobalConstant("RUBY_REVISION", runtime.newFixnum(Constants.RUBY_REVISION));
144+
runtime.defineGlobalConstant("RUBY_ENGINE", engine);
145+
runtime.defineGlobalConstant("RUBY_ENGINE_VERSION", jrubyVersion);
145146

146147
RubyInstanceConfig.Verbosity verbosity = runtime.getInstanceConfig().getVerbosity();
147148
runtime.defineVariable(new WarningGlobalVariable(runtime, "$-W", verbosity), GLOBAL);

spec/jruby/compat_spec.rb

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
describe "Cross-platform compatibility" do
2+
it "defines RUBY_ENGINE" do
3+
expect(defined?(RUBY_ENGINE)).to_not eq nil
4+
end
5+
6+
it "defines RUBY_ENGINE_VERSION" do
7+
expect(defined?(RUBY_ENGINE_VERSION)).to_not eq nil
8+
end
9+
end

spec/mspec/.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: ruby
22
script:
33
- bundle exec rspec
4-
jdk:
5-
- openjdk7
64
rvm:
75
- 1.8.7
86
- 1.9.3

spec/mspec/Gemfile.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ GEM
88
specs:
99
diff-lcs (1.2.5)
1010
rake (10.4.2)
11-
rspec (2.99.0)
12-
rspec-core (~> 2.99.0)
13-
rspec-expectations (~> 2.99.0)
14-
rspec-mocks (~> 2.99.0)
15-
rspec-core (2.99.2)
16-
rspec-expectations (2.99.2)
11+
rspec (2.14.1)
12+
rspec-core (~> 2.14.0)
13+
rspec-expectations (~> 2.14.0)
14+
rspec-mocks (~> 2.14.0)
15+
rspec-core (2.14.8)
16+
rspec-expectations (2.14.5)
1717
diff-lcs (>= 1.1.3, < 2.0)
18-
rspec-mocks (2.99.3)
18+
rspec-mocks (2.14.6)
1919

2020
PLATFORMS
2121
java
@@ -24,4 +24,4 @@ PLATFORMS
2424
DEPENDENCIES
2525
mspec!
2626
rake (~> 10.0)
27-
rspec (~> 2.8)
27+
rspec (~> 2.14.1)

spec/mspec/lib/mspec/runner/actions/tally.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ def tag
6262
end
6363

6464
def format
65-
results = [ file, example, expectation, failure, error ]
65+
results = [ file, example, expectation, failure, error, tag ]
6666
if [:report, :report_on, :verify].any? { |m| MSpec.mode? m }
6767
results << guard
68-
results << tag
6968
end
7069
results.join(", ")
7170
end

spec/mspec/mspec.gemspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ MSpec attempts to use the simplest Ruby language features
2727
so that beginning Ruby implementations can run it.
2828
EOS
2929
gem.has_rdoc = true
30-
gem.extra_rdoc_files = %w[ README LICENSE ]
30+
gem.extra_rdoc_files = %w[ README.md LICENSE ]
3131
gem.rubygems_version = %q{1.3.5}
3232
gem.rubyforge_project = 'http://rubyforge.org/projects/mspec'
3333

3434
gem.rdoc_options << '--title' << 'MSpec Gem' <<
35-
'--main' << 'README' <<
35+
'--main' << 'README.md' <<
3636
'--line-numbers'
3737

3838
gem.add_development_dependency "rake", "~> 10.0"
39-
gem.add_development_dependency "rspec", "~> 2.8"
39+
gem.add_development_dependency "rspec", "~> 2.14.1"
4040
end

spec/mspec/spec/commands/mspec_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
144144
Finished in 42 seconds
145145
146-
2 files, 2 examples, 4 expectations, 0 failures, 0 errors
146+
2 files, 2 examples, 4 expectations, 0 failures, 0 errors, 0 tagged
147147
]
148148
end
149149

@@ -174,7 +174,7 @@
174174
175175
Finished in 42 seconds
176176
177-
1 file, 1 example, 2 expectations, 0 failures, 0 errors
177+
1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
178178
]
179179
end
180180
end

spec/mspec/spec/runner/actions/tally_spec.rb

+8-5
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@
180180
@tally.examples! 2
181181
@tally.expectations! 4
182182
@tally.errors!
183-
@tally.format.should == "1 file, 2 examples, 4 expectations, 0 failures, 1 error"
183+
@tally.tagged!
184+
@tally.format.should == "1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged"
184185
end
185186

186187
it "includes guards if MSpec is in verify mode" do
@@ -189,9 +190,10 @@
189190
@tally.examples! 2
190191
@tally.expectations! 4
191192
@tally.errors!
193+
@tally.tagged!
192194
@tally.guards!
193195
@tally.format.should ==
194-
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 guard, 0 tagged"
196+
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged, 1 guard"
195197
end
196198

197199
it "includes guards if MSpec is in report mode" do
@@ -200,9 +202,10 @@
200202
@tally.examples! 2
201203
@tally.expectations! 4
202204
@tally.errors!
205+
@tally.tagged!
203206
@tally.guards! 2
204207
@tally.format.should ==
205-
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 2 guards, 0 tagged"
208+
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged, 2 guards"
206209
end
207210

208211
it "includes guards if MSpec is in report_on mode" do
@@ -213,7 +216,7 @@
213216
@tally.errors!
214217
@tally.guards! 2
215218
@tally.format.should ==
216-
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 2 guards, 0 tagged"
219+
"1 file, 2 examples, 4 expectations, 0 failures, 1 error, 0 tagged, 2 guards"
217220
end
218221
end
219222

@@ -312,7 +315,7 @@
312315
@tally.expectation @state
313316
exc = ExceptionState.new nil, nil, SpecExpectationNotMetError.new("Failed!")
314317
@tally.exception exc
315-
@tally.format.should == "1 file, 1 example, 2 expectations, 1 failure, 0 errors"
318+
@tally.format.should == "1 file, 1 example, 2 expectations, 1 failure, 0 errors, 0 tagged"
316319
end
317320
end
318321

spec/mspec/spec/runner/formatters/describe_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
it "prints a tally of counts" do
3939
@formatter.finish
40-
@out.should =~ /^1 file, 1 example, 2 expectations, 0 failures, 0 errors$/
40+
@out.should =~ /^1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged$/
4141
end
4242

4343
it "does not print exceptions" do
@@ -46,7 +46,7 @@
4646
4747
Finished in 2.0 seconds
4848
49-
1 file, 1 example, 2 expectations, 0 failures, 0 errors
49+
1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
5050
]
5151
end
5252

@@ -61,7 +61,7 @@
6161
6262
Finished in 2.0 seconds
6363
64-
1 file, 1 example, 2 expectations, 0 failures, 0 errors
64+
1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
6565
]
6666
end
6767
end

spec/ruby/core/argf/close_spec.rb

+4-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@
2626

2727
ruby_version_is ""..."2.3" do
2828
# This passes on 1.9 and 1.8 HEAD, but fails on 1.8.7 and 1.8.6
29-
ruby_bug "#1633", "1.8.7.174" do
30-
it "raises an IOError if called on a closed stream" do
31-
argv [@file1_name] do
32-
lambda { ARGF.close }.should_not raise_error
33-
lambda { ARGF.close }.should raise_error(IOError)
34-
end
29+
it "raises an IOError if called on a closed stream" do
30+
argv [@file1_name] do
31+
lambda { ARGF.close }.should_not raise_error
32+
lambda { ARGF.close }.should raise_error(IOError)
3533
end
3634
end
3735
end

spec/ruby/core/argf/lineno_spec.rb

+7-9
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@
2626
end
2727
end
2828

29-
ruby_bug "#1693", "1.8" do
30-
it "resets to 0 after the stream is rewound" do
31-
argv [@file1, @file2, @file1, @file2] do
32-
ARGF.lineno = 0
33-
ARGF.lineno.should == 0
34-
ARGF.readline
35-
ARGF.rewind
36-
ARGF.lineno.should == 0
37-
end
29+
it "resets to 0 after the stream is rewound" do
30+
argv [@file1, @file2, @file1, @file2] do
31+
ARGF.lineno = 0
32+
ARGF.lineno.should == 0
33+
ARGF.readline
34+
ARGF.rewind
35+
ARGF.lineno.should == 0
3836
end
3937
end
4038

spec/ruby/core/argf/rewind_spec.rb

+7-9
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828
end
2929
end
3030

31-
ruby_bug "#1693", "1.8" do
32-
it "resets ARGF.lineno to 0" do
33-
argv [@file2_name] do
34-
ARGF.lineno = 0
35-
ARGF.gets;
36-
ARGF.lineno.should > 0
37-
ARGF.rewind;
38-
ARGF.lineno.should == 0
39-
end
31+
it "resets ARGF.lineno to 0" do
32+
argv [@file2_name] do
33+
ARGF.lineno = 0
34+
ARGF.gets;
35+
ARGF.lineno.should > 0
36+
ARGF.rewind;
37+
ARGF.lineno.should == 0
4038
end
4139
end
4240

spec/ruby/core/array/comparison_spec.rb

+12-16
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,19 @@
6464
(lhs <=> rhs).should == +1
6565
end
6666

67-
ruby_bug "#", "1.8.6.277" do
68-
it "properly handles recursive arrays" do
69-
empty = ArraySpecs.empty_recursive_array
70-
(empty <=> empty).should == 0
71-
(empty <=> []).should == 1
72-
([] <=> empty).should == -1
67+
it "properly handles recursive arrays" do
68+
empty = ArraySpecs.empty_recursive_array
69+
(empty <=> empty).should == 0
70+
(empty <=> []).should == 1
71+
([] <=> empty).should == -1
7372

74-
(ArraySpecs.recursive_array <=> []).should == 1
75-
([] <=> ArraySpecs.recursive_array).should == -1
73+
(ArraySpecs.recursive_array <=> []).should == 1
74+
([] <=> ArraySpecs.recursive_array).should == -1
7675

77-
(ArraySpecs.recursive_array <=> ArraySpecs.empty_recursive_array).should == nil
76+
(ArraySpecs.recursive_array <=> ArraySpecs.empty_recursive_array).should == nil
7877

79-
array = ArraySpecs.recursive_array
80-
(array <=> array).should == 0
81-
end
78+
array = ArraySpecs.recursive_array
79+
(array <=> array).should == 0
8280
end
8381

8482
it "tries to convert the passed argument to an Array using #to_ary" do
@@ -93,9 +91,7 @@
9391
([5, 6, 7] <=> obj).should == 0
9492
end
9593

96-
ruby_bug "redmine:2276", "1.9.1" do
97-
it "returns nil when the argument is not array-like" do
98-
([] <=> false).should be_nil
99-
end
94+
it "returns nil when the argument is not array-like" do
95+
([] <=> false).should be_nil
10096
end
10197
end

spec/ruby/core/array/fill_spec.rb

+22-32
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@
5454
it "raises an ArgumentError if 4 or more arguments are passed when no block given" do
5555
lambda { [].fill('a') }.should_not raise_error(ArgumentError)
5656

57-
ruby_bug "#", "1.8.6.277" do
58-
lambda { [].fill('a', 1) }.should_not raise_error(ArgumentError)
59-
end
57+
lambda { [].fill('a', 1) }.should_not raise_error(ArgumentError)
6058

6159
lambda { [].fill('a', 1, 2) }.should_not raise_error(ArgumentError)
6260
lambda { [].fill('a', 1, 2, true) }.should raise_error(ArgumentError)
@@ -69,9 +67,7 @@
6967
it "raises an ArgumentError if 3 or more arguments are passed when a block given" do
7068
lambda { [].fill() {|i|} }.should_not raise_error(ArgumentError)
7169

72-
ruby_bug "#", "1.8.6.277" do
73-
lambda { [].fill(1) {|i|} }.should_not raise_error(ArgumentError)
74-
end
70+
lambda { [].fill(1) {|i|} }.should_not raise_error(ArgumentError)
7571

7672
lambda { [].fill(1, 2) {|i|} }.should_not raise_error(ArgumentError)
7773
lambda { [].fill(1, 2, true) {|i|} }.should raise_error(ArgumentError)
@@ -163,41 +159,35 @@
163159
[1, 2, 3, 4, 5].fill('a', 2, 0).should == [1, 2, 3, 4, 5]
164160
[1, 2, 3, 4, 5].fill('a', -2, 0).should == [1, 2, 3, 4, 5]
165161

166-
ruby_bug "#", "1.8.6.277" do
167-
[1, 2, 3, 4, 5].fill('a', 2, -2).should == [1, 2, 3, 4, 5]
168-
[1, 2, 3, 4, 5].fill('a', -2, -2).should == [1, 2, 3, 4, 5]
169-
end
162+
[1, 2, 3, 4, 5].fill('a', 2, -2).should == [1, 2, 3, 4, 5]
163+
[1, 2, 3, 4, 5].fill('a', -2, -2).should == [1, 2, 3, 4, 5]
170164

171165
[1, 2, 3, 4, 5].fill(2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
172166
[1, 2, 3, 4, 5].fill(-2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
173167

174-
ruby_bug "#", "1.8.6.277" do
175-
[1, 2, 3, 4, 5].fill(2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
176-
[1, 2, 3, 4, 5].fill(-2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
177-
end
168+
[1, 2, 3, 4, 5].fill(2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
169+
[1, 2, 3, 4, 5].fill(-2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
178170
end
179171

180-
ruby_bug "#", "1.8.6.277" do
181-
# See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17481
182-
it "does not raise an exception if the given length is negative and its absolute value does not exceed the index" do
183-
lambda { [1, 2, 3, 4].fill('a', 3, -1)}.should_not raise_error(ArgumentError)
184-
lambda { [1, 2, 3, 4].fill('a', 3, -2)}.should_not raise_error(ArgumentError)
185-
lambda { [1, 2, 3, 4].fill('a', 3, -3)}.should_not raise_error(ArgumentError)
172+
# See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17481
173+
it "does not raise an exception if the given length is negative and its absolute value does not exceed the index" do
174+
lambda { [1, 2, 3, 4].fill('a', 3, -1)}.should_not raise_error(ArgumentError)
175+
lambda { [1, 2, 3, 4].fill('a', 3, -2)}.should_not raise_error(ArgumentError)
176+
lambda { [1, 2, 3, 4].fill('a', 3, -3)}.should_not raise_error(ArgumentError)
186177

187-
lambda { [1, 2, 3, 4].fill(3, -1, &@never_passed)}.should_not raise_error(ArgumentError)
188-
lambda { [1, 2, 3, 4].fill(3, -2, &@never_passed)}.should_not raise_error(ArgumentError)
189-
lambda { [1, 2, 3, 4].fill(3, -3, &@never_passed)}.should_not raise_error(ArgumentError)
190-
end
178+
lambda { [1, 2, 3, 4].fill(3, -1, &@never_passed)}.should_not raise_error(ArgumentError)
179+
lambda { [1, 2, 3, 4].fill(3, -2, &@never_passed)}.should_not raise_error(ArgumentError)
180+
lambda { [1, 2, 3, 4].fill(3, -3, &@never_passed)}.should_not raise_error(ArgumentError)
181+
end
191182

192-
it "does not raise an exception even if the given length is negative and its absolute value exceeds the index" do
193-
lambda { [1, 2, 3, 4].fill('a', 3, -4)}.should_not raise_error(ArgumentError)
194-
lambda { [1, 2, 3, 4].fill('a', 3, -5)}.should_not raise_error(ArgumentError)
195-
lambda { [1, 2, 3, 4].fill('a', 3, -10000)}.should_not raise_error(ArgumentError)
183+
it "does not raise an exception even if the given length is negative and its absolute value exceeds the index" do
184+
lambda { [1, 2, 3, 4].fill('a', 3, -4)}.should_not raise_error(ArgumentError)
185+
lambda { [1, 2, 3, 4].fill('a', 3, -5)}.should_not raise_error(ArgumentError)
186+
lambda { [1, 2, 3, 4].fill('a', 3, -10000)}.should_not raise_error(ArgumentError)
196187

197-
lambda { [1, 2, 3, 4].fill(3, -4, &@never_passed)}.should_not raise_error(ArgumentError)
198-
lambda { [1, 2, 3, 4].fill(3, -5, &@never_passed)}.should_not raise_error(ArgumentError)
199-
lambda { [1, 2, 3, 4].fill(3, -10000, &@never_passed)}.should_not raise_error(ArgumentError)
200-
end
188+
lambda { [1, 2, 3, 4].fill(3, -4, &@never_passed)}.should_not raise_error(ArgumentError)
189+
lambda { [1, 2, 3, 4].fill(3, -5, &@never_passed)}.should_not raise_error(ArgumentError)
190+
lambda { [1, 2, 3, 4].fill(3, -10000, &@never_passed)}.should_not raise_error(ArgumentError)
201191
end
202192

203193
it "tries to convert the second and third arguments to Integers using #to_int" do

0 commit comments

Comments
 (0)