Skip to content

Commit

Permalink
add failing test for being unable to cacht throw in around
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Sep 25, 2023
1 parent 8e0d08c commit 1be7d30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/cases/around_throw.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require "./spec/cases/helper"

describe "2" do
around { |test| catch(:foo) { test.call } }

it "can throw" do
1.must_equal 1
throw :foo
end
end
4 changes: 4 additions & 0 deletions spec/maxitest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
run_cmd("ruby spec/cases/around.rb").should include "\n2 runs, 3 assertions"
end

it "can catch in around" do
run_cmd("ruby spec/cases/around_throw.rb").should include "\n1 runs, 1 assertion"
end

it "informs user about missing around :all" do
with_env HOOK_TYPE: "all" do
out = run_cmd("ruby spec/cases/around.rb", fail: true)
Expand Down

0 comments on commit 1be7d30

Please sign in to comment.