hspec 0.9.1 → 0.9.1.1
raw patch · 6 files changed
+19/−10 lines, 6 filesnew-uploader
Files
- Test/Hspec.hs +1/−1
- Test/Hspec/Core.hs +7/−7
- Test/Hspec/HUnit.hs +3/−1
- Test/Hspec/Monadic.hs +5/−0
- Test/Hspec/QuickCheck.hs +2/−0
- hspec.cabal +1/−1
Test/Hspec.hs view
@@ -59,7 +59,7 @@ -- > let actual = unformatPhoneNumber "NUMBERS" -- > assertEqual "letters to numbers" expected actual), ----- The 'property' function allows a QuickCheck property to act as an example. (must import @Test.Hspec.HUnit@)+-- The 'property' function allows a QuickCheck property to act as an example. (must import @Test.Hspec.QuickCheck@) -- -- > it "can add and remove formatting without changing the number" -- > (property $ forAll phoneNumber $
Test/Hspec/Core.hs view
@@ -16,23 +16,23 @@ -- | Everything needed to specify and show a specific behavior. data Spec = Spec {- -- | What is being tested, usually the name of a type.+ -- | What is being tested, usually the name of a type or use case. name::String,- -- | The specific behavior being tested.+ -- | A description of the specific behavior being tested. requirement::String, -- | The status of the example of this behavior. result::Result, -- | The level of nestedness.- depth :: Int }+ depth::Int } | UnevaluatedSpec {- -- | What is being tested, usually the name of a type.+ -- | What is being tested, usually the name of a type or use case. name::String,- -- | The specific behavior being tested.+ -- | A description of the specific behavior being tested. requirement::String, -- | An example of this behavior. example::AnyExample, -- | The level of nestedness.- depth :: Int }+ depth::Int } data Formatter = Formatter { formatterName :: String,@@ -126,6 +126,6 @@ isFailure _ = False -- | Create a more readable display of a quantity of something.-quantify :: Num a => a -> String -> String+quantify :: (Show a, Num a, Eq a) => a -> String -> String quantify 1 s = "1 " ++ s quantify n s = show n ++ " " ++ s ++ "s"
Test/Hspec/HUnit.hs view
@@ -3,7 +3,9 @@ -- | Importing this module allows you to use an @HUnit@ test case as an example -- for a behavior. You can use an explicit @TestCase@ data constructor or -- use an @IO()@ action. For an @IO()@ action, any exception means the example--- failed; otherwise, it's successfull.+-- failed; otherwise, it's successfull. Any output from the example to stdout is+-- ignored. If you need to write out for debugging, you can write to stderr or+-- a file handle. -- -- > describe "cutTheDeck" [ -- > it "puts the first half of a list after the last half"
Test/Hspec/Monadic.hs view
@@ -71,6 +71,8 @@ describe, it, hspec, hspecB, hspecX, pending, descriptions, -- alternate "runner" functions hHspec,+ -- interface to the non-monadic api+ fromSpecList, -- this is just for internal use runSpecM ) where@@ -120,3 +122,6 @@ it :: Example v => String -> v -> Specs it label action = SpecM . tell $ Core.it label action +-- | Converts a specs created with 'Test.Hspec.HUnit.describe' into a monadic 'describe'.+fromSpecList :: [Spec] -> Specs+fromSpecList = SpecM . tell
Test/Hspec/QuickCheck.hs view
@@ -1,6 +1,8 @@ -- | Importing this module allows you to use a QuickCheck property as an example -- for a behavior. Use the 'property' function to indicate a QuickCkeck property.+-- Any output from the example to stdout is ignored. If you need to write out for+-- debugging, you can write to stderr or a file handle. -- -- > describe "cutTheDeck" [ -- > it "puts the first half of a list after the last half"
hspec.cabal view
@@ -1,5 +1,5 @@ name: hspec-version: 0.9.1+version: 0.9.1.1 cabal-version: >= 1.8 build-type: Custom license: BSD3