Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

print-facts line numbering produces nulls for some facts #167

Closed
marick opened this Issue Jan 25, 2013 · 1 comment

Comments

Projects
None yet
1 participant
Owner

marick commented Jan 25, 2013

(ns scratch.test.core
  (:require [midje.sweet :refer :all]
            [midje.config :as config]))


(config/at-print-level :print-facts
  (defn f [] "base")

  (fact "one" ; "Checking one"
        (f) => "base")

  (fact "two" ; "Checking fact at (test.clj:null)"
        (against-background (f) => 2)
        (f) => 2)

  (against-background
    [(f) => 3]
    (fact "three" ; "Checking three"
          (f) => 3))

  (fact "four wrong use of against-background" ; "Checking fact at (test.clj:null)"
        (against-background
          [ (f) => 4 ]
          (try (f) => "this is"
            (f) => "ignored"
            (finally "done"))
        (f) => "ignored here too"))

  (fact "five"
        (f) => "base"
        (f) => 5
        (provided (f) => 5)))

Produces:

Checking one
Checking fact at (scratch/test/core.clj:null)
Checking three
Checking fact at (scratch/test/core.clj:null)
Checking five

The nulls are bad.

Owner

marick commented Jan 29, 2013

Boy, I'll be glad when I can jettison against-background.

@marick marick closed this Jan 29, 2013

marick added a commit that referenced this issue Jan 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment