Skip to content

Support for RSpec-style `subject` and one-liner it-blocks

License

Notifications You must be signed in to change notification settings

hspec/hspec-subject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Given the following boilerplate

{-# LANGUAGE QuasiQuotes #-}
module Main where
import           Test.Hspec
import           Test.Hspec.Subject

main :: IO ()
main = hspec spec

this can be used like so

spec :: Spec
spec = do
  [describe_|23 + 42|] $ do
    [it_|`shouldBe` 65|]

which is equivalent to

spec :: Spec
spec = do
  describe "23 + 42" $ do
    subject (23 + 42) $ do
      it "`shouldBe` 65" (`shouldBe` 65)

(note that subject is just an alias for before . return)

About

Support for RSpec-style `subject` and one-liner it-blocks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published