athena-framework / athena

An ecosystem of reusable, independent components
https://athenaframework.org
MIT License
211 stars 17 forks source link

Exceptions within `#initialize` are not reported as errors #275

Closed Blacksmoke16 closed 1 year ago

Blacksmoke16 commented 1 year ago

Given something like:

struct ExampleTest < ASPEC::TestCase
  def initialize
    raise "oh noes"
  end

  def test_one
    1.should eq 1
  end
end

The exception being raised within #initialize prevents the describe block for this type being created due to the first .new call. However, the error is not silent, it still is printed to the terminal. But it should probably rescue the exception and re-raise it such that all of the instance's test cases report that error versus being excluded from the spec output.