marick / Midje

Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing
MIT License
1.69k stars 129 forks source link

Runtime check to see if a =contains=> target variable resolves to map #400

Closed philomates closed 7 years ago

philomates commented 7 years ago

Follow-up to https://github.com/marick/Midje/pull/399 ensuring that variables are taken into account.

For example, the following failed after the https://github.com/marick/Midje/pull/399 changes:

(let [some-map {:header 50}]
  (fact "=contains=> pointing to a map var works"
    (:header (gen-doc)) => 50
    (provided
      ..doc.. =contains=> some-map
      (gen-doc) => ..doc..)))

Thanks to @rafaeldff for the catch