Closed herwinw closed 2 months ago
For future reference: I hacked this together:
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'json'
spec = JSON.load_file('current.json')['stats']['spec']
walk_spec = lambda do |part|
part.flat_map do |key, value|
if value.key?('compiled')
if value['compiled'] && !value['crashed'] && value['errors'].zero? && value['failures'].zero? && value['success'].positive? && !value['timeouted']
[key]
else
[]
end
else
result = walk_spec.call(value)
if result.empty?
[]
else
result.map { |rest| "#{key}/#{rest}" }
end
end
end
end
passing = walk_spec.call(spec)
passing.each do |file|
`cp ../ruby-spec/#{file} spec/#{file}`
end
This one includes some changes likes:
- # NATFIXME: Inconsistent results. We can probably fix this once we implement IO#close_read
- xit "raises IOError on stream not opened for reading" do
+ it "raises IOError on stream not opened for reading" do
-> { STDOUT.ungetbyte(42) }.should raise_error(IOError, "not opened for reading")
end
So I probably need to get through all of them before I feel comfortable merging this.
Additional updates:
Sweet.
I used a script to find all fully passing upstream specs and copy them from a local checkout.