File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,23 @@ module RSpec::Core
319
319
expect ( filters ) . to eq ( [ ] )
320
320
end
321
321
322
+ it "does not run :all|:context hooks if the entire context is skipped" do
323
+ filters = [ ]
324
+ RSpec . configure do |c |
325
+ c . before ( :all ) { filters << "before all in config" }
326
+ c . after ( :all ) { filters << "after all in config" }
327
+ c . before ( :context ) { filters << "before context in config" }
328
+ c . after ( :context ) { filters << "after context in config" }
329
+ end
330
+ group = RSpec . xdescribe ( "skipped describe" ) do
331
+ xcontext ( "skipped context" ) do
332
+ it ( "is skipped" ) { }
333
+ end
334
+ end
335
+ group . run
336
+ expect ( filters ) . to eq ( [ ] )
337
+ end
338
+
322
339
context "when the hook filters apply to individual examples instead of example groups" do
323
340
let ( :each_filters ) { [ ] }
324
341
let ( :all_filters ) { [ ] }
You can’t perform that action at this time.
0 commit comments