Skip to content

Can't run the tests #25

Closed
Closed
@erikd

Description

Having an incredible amount of difficulty simply running the tests.

In PR #23 I mentioned this and you said you run the tests in GHCi. I tried, but this is rather non-trivial because I'm running in a cabal sandbox:

$ cabal exec -- ghci -itest test/Test/Hspec/ExpectationsSpec.hs 
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help

test/Test/Hspec/ExpectationsSpec.hs:11:18:
    Could not find module ‘Test.Hspec’
    Use -v to see a list of the files searched for.
Failed, modules loaded: none.

So I installed hspec and tried again, only to get a number of errors like:

test/Test/Hspec/ExpectationsSpec.hs:61:7: Warning:
    No instance for (Data.String.IsString (t0 a0))
      arising from the literal ‘""’
    The type variables ‘t0’, ‘a0’ are ambiguous
    Note: there is a potential instance available:
      instance Data.String.IsString [Char] -- Defined in ‘Data.String’
    In the first argument of ‘shouldSatisfy’, namely ‘""’
    In a stmt of a 'do' block: "" `shouldSatisfy` null
    In the second argument of ‘($)’, namely
      ‘do { "" `shouldSatisfy` null }’

On top of that, the lack of any tests in the cabal file means that the travis script can't build and run the tests.

So I tried to add a testsuite section to the cabal file only to find that the there seems to be a circular dependency between hspec-expectations and hspec and hspec-discover that cabal doesn't seem to be able to resolve. The solution seems to be to test hspec-expectations with something other than hspec itself.

Would you accept a PR that adds a proper working testsuite section to the cabal file?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions