diff --git a/spec/mspec/lib/mspec/helpers/io.rb b/spec/mspec/lib/mspec/helpers/io.rb index 57dc0d53a4..5361fb9564 100644 --- a/spec/mspec/lib/mspec/helpers/io.rb +++ b/spec/mspec/lib/mspec/helpers/io.rb @@ -84,6 +84,10 @@ def new_io(name, mode="w:utf-8") IO.new new_fd(name, options_or_mode(mode)), options_or_mode(mode) end +def find_unused_fd + Dir.entries("/dev/fd").map(&:to_i).max + 1 +end + # This helper simplifies passing file access modes regardless of # whether the :encoding feature is enabled. Only the access specifier # itself will be returned if :encoding is not enabled. Otherwise, diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb index 120a4ad64c..e978ea17ec 100644 --- a/spec/mspec/tool/sync/sync-rubyspec.rb +++ b/spec/mspec/tool/sync/sync-rubyspec.rb @@ -160,9 +160,12 @@ def test_new_specs require "yaml" Dir.chdir(SOURCE_REPO) do versions = YAML.load_file(".travis.yml") - versions = versions["matrix"]["include"].map { |job| job["rvm"] } - versions.delete "ruby-head" - versions.delete "system" + versions = if versions.include? "matrix" + versions["matrix"]["include"].map { |job| job["rvm"] } + else + versions["rvm"] + end + versions = versions.grep(/^\d+\./) # Test on MRI min_version, max_version = versions.minmax test_command = MSPEC ? "bundle exec rspec" : "../mspec/bin/mspec -j"