stackbuilders / hspec-golden

Golden tests with Hspec
MIT License
26 stars 8 forks source link

Create a helper that uses the test description for the golden file #44

Closed CristhianMotoche closed 6 months ago

CristhianMotoche commented 1 year ago

The golden file name is required in the d function. Let's create a helper that users the test description to name the golden test as suggested in this issue. The helper needs to meet the following criteria:

  1. Make the test readable:
describe "my golden suite" $
  golden "hello world" $ do
     let output =  "MY OUTPUT"
     runGolden output
  1. golden will replace it (from hspec) and runGolden will replace defaultGolden
  2. If there are multiple runGolden in a golden suite the last one will be taken (this could change in the future)
FranzGB commented 7 months ago

Can we close this issue now @CristhianMotoche ?

CristhianMotoche commented 6 months ago

Yes we can! Thanks @FranzGB