Skip to content

Commit af9ee2d

Browse files
authored
Merge pull request jruby#8499 from andrykonchin/update-specs
Update ruby/spec
2 parents 311ce2d + 1e405e4 commit af9ee2d

Some content is hidden

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

55 files changed

+1653
-496
lines changed

spec/mspec/lib/mspec/commands/mspec-run.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def options(argv = ARGV)
3232
options.chdir
3333
options.prefix
3434
options.configure { |f| load f }
35+
options.env
3536
options.randomize
3637
options.repeat
3738
options.pretend

spec/mspec/lib/mspec/utils/options.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ def configure(&block)
204204
"Load FILE containing configuration options", &block)
205205
end
206206

207+
def env
208+
on("--env", "KEY=VALUE", "Set environment variable") do |env|
209+
key, value = env.split('=', 2)
210+
ENV[key] = value
211+
end
212+
end
213+
207214
def targets
208215
on("-t", "--target", "TARGET",
209216
"Implementation to run the specs, where TARGET is:") do |t|
@@ -484,6 +491,7 @@ def debug
484491

485492
def all
486493
configure {}
494+
env
487495
targets
488496
formatters
489497
filters

spec/mspec/tool/sync/sync-rubyspec.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
CHECK_LAST_MERGE = !MSPEC && ENV['CHECK_LAST_MERGE'] != 'false'
2424
TEST_MASTER = ENV['TEST_MASTER'] != 'false'
2525

26+
ONLY_FILTER = ENV['ONLY_FILTER'] == 'true'
27+
2628
MSPEC_REPO = File.expand_path("../../..", __FILE__)
2729
raise MSPEC_REPO if !Dir.exist?(MSPEC_REPO) or !Dir.exist?("#{MSPEC_REPO}/.git")
2830

@@ -230,15 +232,17 @@ def main(impls)
230232
impl = RubyImplementation.new(impl, data)
231233
update_repo(impl)
232234
filter_commits(impl)
233-
rebase_commits(impl)
234-
if new_commits?(impl)
235-
test_new_specs
236-
verify_commits(impl)
237-
fast_forward_master(impl)
238-
check_ci
239-
else
240-
STDERR.puts "#{BRIGHT_YELLOW}No new commits#{RESET}"
241-
fast_forward_master(impl)
235+
unless ONLY_FILTER
236+
rebase_commits(impl)
237+
if new_commits?(impl)
238+
test_new_specs
239+
verify_commits(impl)
240+
fast_forward_master(impl)
241+
check_ci
242+
else
243+
STDERR.puts "#{BRIGHT_YELLOW}No new commits#{RESET}"
244+
fast_forward_master(impl)
245+
end
242246
end
243247
end
244248
end

spec/ruby/command_line/dash_v_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ruby_exe(nil, args: '-v').sub("+PRISM ", "").should include(RUBY_DESCRIPTION.sub("+PRISM ", ""))
1010
end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
1111
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) ||
12+
(ENV['RUBY_GC_LIBRARY'] && ENV['RUBY_GC_LIBRARY'].length > 0) ||
1213
(ENV['RUBY_MN_THREADS'] == '1')
1314
end
1415
end

spec/ruby/command_line/rubyopt_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
guard -> { RbConfig::CONFIG["CROSS_COMPILING"] != "yes" } do
2626
it "prints the version number for '-v'" do
2727
ENV["RUBYOPT"] = '-v'
28-
ruby_exe("").sub("+PRISM ", "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "")
28+
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")
2929
end
3030

3131
it "ignores whitespace around the option" do
3232
ENV["RUBYOPT"] = ' -v '
33-
ruby_exe("").sub("+PRISM ", "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "")
33+
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")
3434
end
3535
end
3636

spec/ruby/core/array/pack/shared/basic.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
# NOTE: Added this case just to not forget about the decision in the ticket
5858
it "raise ArgumentError when a directive is unknown" do
5959
# additional directive ('a') is required for the X directive
60-
-> { [@obj, @obj].pack("a R" + pack_format) }.should raise_error(ArgumentError)
61-
-> { [@obj, @obj].pack("a 0" + pack_format) }.should raise_error(ArgumentError)
62-
-> { [@obj, @obj].pack("a :" + pack_format) }.should raise_error(ArgumentError)
60+
-> { [@obj, @obj].pack("a R" + pack_format) }.should raise_error(ArgumentError, /unknown pack directive 'R'/)
61+
-> { [@obj, @obj].pack("a 0" + pack_format) }.should raise_error(ArgumentError, /unknown pack directive '0'/)
62+
-> { [@obj, @obj].pack("a :" + pack_format) }.should raise_error(ArgumentError, /unknown pack directive ':'/)
6363
end
6464
end
6565

spec/ruby/core/basicobject/equal_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
it "is unaffected by overriding __id__" do
1212
o1 = mock("object")
1313
o2 = mock("object")
14-
def o1.__id__; 10; end
15-
def o2.__id__; 10; end
14+
suppress_warning {
15+
def o1.__id__; 10; end
16+
def o2.__id__; 10; end
17+
}
1618
o1.equal?(o2).should be_false
1719
end
1820

spec/ruby/core/dir/shared/glob.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
end
1313

1414
it "raises an Encoding::CompatibilityError if the argument encoding is not compatible with US-ASCII" do
15-
pattern = "file*".dup.force_encoding Encoding::UTF_16BE
15+
pattern = "files*".dup.force_encoding Encoding::UTF_16BE
1616
-> { Dir.send(@method, pattern) }.should raise_error(Encoding::CompatibilityError)
1717
end
1818

0 commit comments

Comments
 (0)