إذا قمت بوضع خطاف around(:suite)
في ملف spec_helper.rb ، فيبدو أنك تتلقى هذا التحذير دائمًا:
WARNING: `around(:suite)` hooks are only supported on the RSpec configuration object.
This `around(:suite)` hook, registered on an example group, will be ignored.
ثم يتجاهل الخطاف بسعادة ، حتى لو تم تعريفه بالفعل على كائن تكوين RSpec. لا يبدو أن أيًا من الصيغتين التاليتين يعملان:
RSpec.configuration.around(:suite) do |example|
RSpec.configure do |config|
config.around(:suite) do |example|
لتكرار المشكلة ، ما عليك سوى التحقق من هذا المستودع الصغير المكون من ملفين وتشغيل rspec
في الجذر:
https://github.com/fimmtiu/rspec-around-suite-bug
~/rspec-around-suite-bug$ rspec
WARNING: `around(:suite)` hooks are only supported on the RSpec configuration object.
This `around(:suite)` hook, registered on an example group, will be ignored. Called
from /.../rspec-around-suite-bug/spec/spec_helper.rb:1:in `<top (required)>'.
WARNING: `around(:suite)` hooks are only supported on the RSpec configuration object.
This `around(:suite)` hook, registered on an example group, will be ignored. Called
from /.../rspec-around-suite-bug/spec/spec_helper.rb:7:in `block in <top (required)>'.
.
Finished in 0.00043 seconds (files took 0.07965 seconds to load)
1 example, 0 failures
لم ندعم أبدًا خطافات around(:suite)
. هل تريد أن تأخذ طعنة لإضافة الدعم لهم؟
حقا؟ أن يفسر ذلك. نعم ، الأمور جنونية بعض الشيء في الوقت الحالي ، لكنني سأحاول أن أجد بعض الوقت في الشهر المقبل لإلقاء نظرة عليها.
رسالة التحذير مضللة بعض الشيء.
لم ندعم أبدًا خطافات (: جناح).
ضد
WARNING: `around(:suite)` hooks are only supported on the RSpec configuration object.
التعليق الأكثر فائدة
رسالة التحذير مضللة بعض الشيء.
ضد