Skip to content

Commit

Permalink
Add allowed feature path for TruffleRuby library wide checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish authored and JonRowe committed Sep 12, 2022
1 parent 3bc981f commit 21508db
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions spec/rspec/expectations_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
require 'rspec/support/spec/library_wide_checks'

RSpec.describe "RSpec::Expectations" do
allowed_loaded_features = [
/stringio/, # Used by `output` matcher. Can't be easily avoided.
/rbconfig/ # required by rspec-support
]

# Truffleruby cext files
allowed_loaded_features << /\/truffle\/cext/ if RSpec::Support::Ruby.truffleruby?

it_behaves_like "library wide checks", "rspec-expectations",
:preamble_for_lib => [
# We define minitest constants because rspec/expectations/minitest_integration
# expects these constants to already be defined.
"module Minitest; class Assertion; end; module Test; end; end",
'require "rspec/expectations"'
],
:allowed_loaded_feature_regexps => [
/stringio/, # Used by `output` matcher. Can't be easily avoided.
/rbconfig/ # required by rspec-support
]
:allowed_loaded_feature_regexps => allowed_loaded_features

it 'does not allow expectation failures to be caught by a bare rescue' do
expect {
Expand Down

0 comments on commit 21508db

Please sign in to comment.