Sha256: c3222dfb0f2e872940b96ed402d29ef64de5e021c8a738cea8ce2d27dae3e7ac
Contents?: true
Size: 709 Bytes
Versions: 14
Compression:
Stored size: 709 Bytes
Contents
module DeepCover module Tools::ExecuteSample # Returns true if the code would have continued, false if the rescue was triggered. def execute_sample(to_execute) # Disable some annoying warning by ruby. We are testing edge cases, so warnings are to be expected. begin Tools.silence_warnings do if to_execute.is_a?(CoveredCode) to_execute.execute_code else to_execute.call end end true rescue RuntimeError => e # In our samples, a simple `raise` doesn't need to be rescued # Other exceptions are not rescued raise unless e.message.empty? false end end end end
Version data entries
14 entries across 14 versions & 1 rubygems