packages feed

hspec-golden 0.2.0.0 → 0.2.0.1

raw patch · 5 files changed

+53/−39 lines, 5 files

Files

ChangeLog.md view
@@ -1,4 +1,8 @@ # Changelog for hspec-golden+## 0.2.0.1+#### Add+* Update docs.+ ## 0.2.0.0 #### Add * More flexible file locations
LICENSE view
@@ -1,30 +1,21 @@-Copyright Stack Builders (c) 2019-2020--All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions are met:+MIT License -    * Redistributions of source code must retain the above copyright-      notice, this list of conditions and the following disclaimer.+Copyright (c) 2022 Stack Builders Inc. -    * Redistributions in binary form must reproduce the above-      copyright notice, this list of conditions and the following-      disclaimer in the documentation and/or other materials provided-      with the distribution.+Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions: -    * Neither the name of Author name here nor the names of other-      contributors may be used to endorse or promote products derived-      from this software without specific prior written permission.+The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
README.md view
@@ -9,7 +9,7 @@  `hspec-golden` allows you to write golden tests using the popular `hspec`. -## Getting started+## Usage  You can write golden tests using `defaultGolden` helper: @@ -54,7 +54,7 @@        in myGoldenTest (show 'myTextFunc) textOutput ``` -## Installing CLI+## Install CLI  You can install the `hspec-golden` command line interface (CLI) with `stack`: @@ -97,11 +97,14 @@ $ hgold -u .myGoldenTest ``` -## Licensing+## License  MIT, see the [LICENSE file](./LICENSE).  ## Contributing-Pull requests for modifications to this program are welcome! Fork and open a PR. -If you're looking for a place to start, you may want to check the [open issue](https://github.com/stackbuilders/hspec-golden/issues).+Do you want to contribute to this project? Please take a look at our [contributing guideline](/docs/CONTRIBUTING.md) to know how you can help us build it.++---+<img src="https://www.stackbuilders.com/media/images/Sb-supports.original.png" alt="Stack Builders" width="50%"></img>+[Check out our libraries](https://github.com/stackbuilders/) | [Join our team](https://www.stackbuilders.com/join-us/)
hspec-golden.cabal view
@@ -1,21 +1,35 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.1.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack ----- hash: 34c8c9ac8723c74e1b8dfdf2b6153ad8f1d4c677cbdf667841dc84bda2db22d4+-- hash: bcde352005f41eaf1fe5597862d833a68d980c6b6c7c9f26d0a098a334a9e343  name:           hspec-golden-version:        0.2.0.0+version:        0.2.0.1 synopsis:       Golden tests for hspec-description:    Please see the README on GitHub at <https://github.com/stackbuilders/hspec-golden#README>+description:    .+                Golden tests store the expected output in a separated file. Each time a golden test+                is executed the output of the subject under test (SUT) is compared with the+                expected output. If the output of the SUT changes then the test will fail until+                the expected output is updated.+                .+                @hspec-golden@ allows you to write golden tests using the popular @hspec@.+                .+                > describe "myFunc" $+                >   it "generates the right output with the right params" $+                >      let output = show $ myFunc params+                >        in defaultGolden "myFunc" output+                .+                Please see the <https://github.com/stackbuilders/hspec-golden#readme README on GitHub>+                for more information. category:       Testing homepage:       https://github.com/stackbuilders/hspec-golden#readme bug-reports:    https://github.com/stackbuilders/hspec-golden/issues author:         Stack Builders-maintainer:     cmotoche@stackbuilders.com-copyright:      2019-2020 Stack Builders Inc+maintainer:     Cristhian Motoche <cmotoche@stackbuilders.com>+copyright:      2019-Present Stack Builders Inc license:        MIT license-file:   LICENSE build-type:     Simple@@ -64,6 +78,8 @@   hs-source-dirs:       test   ghc-options: -threaded -rtsopts -with-rtsopts=-N+  build-tool-depends:+      hspec-discover:hspec-discover >=2.0 && <3.0   build-depends:       base >=4.6 && <5     , directory
src/Test/Hspec/Golden.hs view
@@ -81,11 +81,11 @@ -- | Transform a GoldenResult into a Result from Hspec  fromGoldenResult :: GoldenResult -> Result-fromGoldenResult SameOutput             = Result "Golden and Actual output hasn't changed" Success+fromGoldenResult SameOutput             = Result "Golden and Actual output didn't change" Success fromGoldenResult FirstExecutionSucceed  = Result "First time execution. Golden file created." Success fromGoldenResult FirstExecutionFail =   Result "First time execution. Golden file created."-         (Failure Nothing (Reason "failFirstTime is set to True"))+         (Failure Nothing (Reason "Golden file did not exist and was created. Failed because failFirstTime is set to True")) fromGoldenResult (MissmatchOutput expected actual) =   Result "Files golden and actual not match"          (Failure Nothing (ExpectedButGot Nothing expected actual))