module TestProf::BeforeAll::RSpec
Helper to wrap the whole example group into a transaction
Public Instance Methods
before_all(setup_fixtures: BeforeAll.config.setup_fixtures, &block)
click to toggle source
# File lib/test_prof/recipes/rspec/before_all.rb, line 9 def before_all(setup_fixtures: BeforeAll.config.setup_fixtures, &block) raise ArgumentError, "Block is required!" unless block if within_before_all? before(:all) do @__inspect_output = "before_all hook" instance_eval(&block) end return end @__before_all_activated__ = true before(:all) do @__inspect_output = "before_all hook" BeforeAll.setup_fixtures(self) if setup_fixtures BeforeAll.begin_transaction do instance_eval(&block) end end after(:all) do BeforeAll.rollback_transaction end end
within_before_all?()
click to toggle source
# File lib/test_prof/recipes/rspec/before_all.rb, line 35 def within_before_all? instance_variable_defined?(:@__before_all_activated__) end