Skip to content

Unable to resolve local names in When and Then #2

@imrekoszo

Description

@imrekoszo

Hi,

Something seems to be broke in When and Then around resolving names. Please see the example below.

(ns cljgiven.test.core
  (:use [cljgiven.core])
  (:use [clojure.test]))

(defn bar [v]
  (inc v))

;; Fails with "Unable to resolve symbol: bar in this context"
(defspec
  name-resolving-fails-in-when
  (Given [foo 1])
  (When result (bar foo))
  (Then (= 2 result)))

;; Fails with "Unable to resolve symbol: bar in this context"
(defspec
  name-resolving-fails-in-then
  (Given [foo 1])
  (Then (= 2 (bar foo))))

;; Passes when names are fully specified
(defspec
  name-resolving-works-when-fully-specified
  (Given [foo 1])
  (When result (cljgiven.test.core/bar foo))
  (Then (= 2 result))
  (Then (= 2 (cljgiven.test.core/bar foo))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions