Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/conformance/rubyspec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ what a ratchet should be:

| stubbed (raises `SpecSkip`) | where |
|---|---|
| `ruby_exe` — no subprocess | `spec_helper.rb:882` |
| `ruby_cmd` — no subprocess command line | `spec_helper.rb:883` |
| `ruby_exe` — no subprocess | `spec_helper.rb:904` |
| `ruby_cmd` — no subprocess command line | `spec_helper.rb:905` |
| `output_to_fd` — no real fd redirection | `spec_helper.rb:280` |

⛔ **That table is the whole list, and it is now derived rather than retyped.**
Expand Down
22 changes: 22 additions & 0 deletions scripts/conformance/rubyspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,28 @@ def with_block_device(&b)
end
def with_feature(*a, &b); _guard_run(true, &b); end
def without_feature(*a, &b); _guard_run(false, &b); end

# ⛔ MSpec.enable_feature IS THE ONLY MSpec METHOD ruby/spec CALLS — measured by
# grepping library/, core/ and language/ for `MSpec.<method>`, which returns
# that one name and nothing else. Without the constant,
# library/socket/spec_helper.rb raises NameError at LOAD, and every file under
# library/socket scores 0.
#
# That is worse than it sounds when the engine being scored is the REFERENCE:
# MRI then contributes 0 to all 56 of those files, a sweep prints
# `control 0 passing, treatment 224 passing, +217`, and the result reads as the
# implementation under test beating MRI. An oracle that cannot load is not a
# low score, it is no measurement at all (#930 is the same lesson, one layer
# down).
#
# It is a no-op because `with_feature` above already runs every feature block
# unconditionally, which is also what the corpus asks for in that file's own
# comment: "we want a constant number of spec examples across Ruby
# implementations, even if they don't define these constants".
module MSpec
def self.enable_feature(*) end
def self.disable_feature(*) end
end
def ruby_exe(*a, **k); ::Kernel.raise(SpecSkip, "ruby_exe subprocess unsupported"); end
def ruby_cmd(*a, **k); ::Kernel.raise(SpecSkip, "ruby_cmd unsupported"); end

Expand Down
Loading