Skip to content
Browse files

Still figuring out good names

  • Loading branch information...
1 parent 51b2538 commit 01b1447b6d1c13ba26157590154119a4f89fd6b7 @marick committed Jan 25, 2013
Showing with 96 additions and 94 deletions.
  1. +1 −1 src/midje/checking/examples.clj
  2. +2 −2 src/midje/error_handling/background_validations.clj
  3. +2 −2 src/midje/parsing/0_to_fact_form/formulas.clj
  4. +3 −3 src/midje/parsing/0_to_fact_form/tabular.clj
  5. +4 −4 src/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/background.clj
  6. +1 −1 src/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/expects.clj
  7. +6 −6 src/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/facts.clj
  8. +2 −2 src/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/future_facts.clj
  9. +1 −1 src/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/metaconstants.clj
  10. +1 −1 src/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/metadata.clj
  11. +2 −2 src/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/prerequisites.clj
  12. +1 −1 src/midje/parsing/2_to_lexical_maps/data_fakes.clj
  13. +1 −1 src/midje/parsing/2_to_lexical_maps/examples.clj
  14. +1 −1 src/midje/parsing/2_to_lexical_maps/fakes.clj
  15. +1 −1 src/midje/parsing/2_to_lexical_maps/folded_fakes.clj
  16. +33 −31 src/midje/parsing/README.md
  17. +5 −5 src/midje/sweet.clj
  18. +1 −1 test/midje/parsing/0_to_fact_form/t_tabular.clj
  19. +4 −4 test/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/t_background.clj
  20. +2 −2 test/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/t_expects.clj
  21. +2 −2 test/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/t_facts.clj
  22. +2 −2 test/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/t_metaconstants.clj
  23. +4 −4 test/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/t_metadata.clj
  24. +3 −3 test/midje/parsing/{1_to_normal_form → 1_to_explicit_form}/t_prerequisites.clj
  25. +11 −11 test/midje/t_repl.clj
View
2 src/midje/checking/examples.clj
@@ -9,7 +9,7 @@
[midje.util.namespace :only [immigrate]])
(:require [midje.config :as config]
[midje.emission.boundaries :as emission-boundary]
- [midje.parsing.1-to-normal-form.background :as background]
+ [midje.parsing.1-to-explicit-form.background :as background]
[midje.emission.api :as emit]))
(defn- minimal-failure-map
View
4 src/midje/error_handling/background_validations.clj
@@ -4,8 +4,8 @@
[midje.error-handling.validation-errors :only [simple-validation-error-report-form
validation-error-report-form validate when-valid]]
[midje.parsing.util.arrows :only [start-of-checking-arrow-sequence? take-arrow-sequence]]
- [midje.parsing.1-to-normal-form.background :only [seq-headed-by-setup-teardown-form?]]
- [midje.parsing.1-to-normal-form.prerequisites :only [metaconstant-prerequisite?]]
+ [midje.parsing.1-to-explicit-form.background :only [seq-headed-by-setup-teardown-form?]]
+ [midje.parsing.1-to-explicit-form.prerequisites :only [metaconstant-prerequisite?]]
[midje.util.form-utils :only [def-many-methods named? pred-cond]]
[midje.util.backwards-compatible-utils :only [some-fn-m]]))
View
4 src/midje/parsing/0_to_fact_form/formulas.clj
@@ -2,9 +2,9 @@
midje.parsing.0-to-fact-form.formulas
(:use [midje.util.form-utils :only [first-named? named? pop-docstring pop-opts-map]]
[midje.error-handling.validation-errors :only [simple-validation-error-report-form validate-m validate]]
- [midje.parsing.1-to-normal-form.prerequisites :only [head-of-form-providing-prerequisites?]]
+ [midje.parsing.1-to-explicit-form.prerequisites :only [head-of-form-providing-prerequisites?]]
[midje.parsing.util.arrows :only [leaf-expect-arrows leaves-contain-arrow?]]
- [midje.parsing.1-to-normal-form.future-facts :only [future-prefixes]]
+ [midje.parsing.1-to-explicit-form.future-facts :only [future-prefixes]]
[clojure.algo.monads :only [domonad]]
[clojure.string :only [join]]
[midje.util.form-utils :only [macro-for]]
View
6 src/midje/parsing/0_to_fact_form/tabular.clj
@@ -7,13 +7,13 @@
[midje.util.form-utils :only [pop-docstring translate-zipper]]
[midje.util.deprecation :only [deprecate]]
[midje.parsing.util.zip :only [skip-to-rightmost-leaf]]
- [midje.parsing.1-to-normal-form.expects :only [expect?]]
+ [midje.parsing.1-to-explicit-form.expects :only [expect?]]
[midje.parsing.util.arrows :only [above-arrow-sequence__add-key-value__at-arrow]]
- [midje.parsing.1-to-normal-form.facts :only [working-on-nested-facts]]
+ [midje.parsing.1-to-explicit-form.facts :only [working-on-nested-facts]]
[midje.data.metaconstant :only [metaconstant-symbol?]]
[utilize.map :only [ordered-zipmap]])
(:require [midje.util.unify :as unify]
- [midje.parsing.1-to-normal-form.metadata :as metadata]))
+ [midje.parsing.1-to-explicit-form.metadata :as metadata]))
(defn- remove-pipes+where [table]
(when (#{:where 'where} (first table))
View
8 ...e/parsing/1_to_normal_form/background.clj → ...parsing/1_to_explicit_form/background.clj
@@ -1,9 +1,9 @@
(ns ^{:doc "Code to be run before, after or around facts. Also,
prerequisites that pertain to a group of facts."}
- midje.parsing.1-to-normal-form.background
+ midje.parsing.1-to-explicit-form.background
(:use [midje.parsing.util.arrows :only [start-of-checking-arrow-sequence? take-arrow-sequence]]
- [midje.parsing.1-to-normal-form.metaconstants :only [predefine-metaconstants-from-form]]
- [midje.parsing.1-to-normal-form.prerequisites :only [metaconstant-prerequisite? prerequisite-to-fake]]
+ [midje.parsing.1-to-explicit-form.metaconstants :only [predefine-metaconstants-from-form]]
+ [midje.parsing.1-to-explicit-form.prerequisites :only [metaconstant-prerequisite? prerequisite-to-fake]]
[midje.data.prerequisite-state :only [with-installed-fakes]]
[midje.parsing.util.wrapping :only [for-wrapping-target? with-wrapping-target]]
[midje.util.form-utils :only [first-named? map-first pred-cond separate-by
@@ -95,7 +95,7 @@
(defn- ^{:testable true } state-wrapper [[_before-after-or-around_ wrapping-target & _ :as state-description]]
(with-wrapping-target
- (macroexpand-1 (map-first #(symbol "midje.parsing.1-to-normal-form.background" (name %)) state-description))
+ (macroexpand-1 (map-first #(symbol "midje.parsing.1-to-explicit-form.background" (name %)) state-description))
wrapping-target))
(letfn [(background-fake-wrappers [fakes]
View
2 ...idje/parsing/1_to_normal_form/expects.clj → ...je/parsing/1_to_explicit_form/expects.clj
@@ -1,6 +1,6 @@
(ns ^{:doc "Mostly functions for identifying semi-sweet expects, and for converting
midje.sweet arrow forms into semi-sweet expcet forms."}
- midje.parsing.1-to-normal-form.expects
+ midje.parsing.1-to-explicit-form.expects
(:use [midje.util.treelike :only [tree-variant]]
[midje.util.namespace :only [matches-symbols-in-semi-sweet-or-sweet-ns?]]
[midje.util.form-utils :only [first-named?]]
View
12 src/midje/parsing/1_to_normal_form/facts.clj → ...idje/parsing/1_to_explicit_form/facts.clj
@@ -1,25 +1,25 @@
(ns ^{:doc "Parsing facts."}
- midje.parsing.1-to-normal-form.facts
+ midje.parsing.1-to-explicit-form.facts
(:use [midje.error-handling.validation-errors :only [validate when-valid]]
[midje.util.namespace :only [semi-sweet-keyword?]]
- [midje.parsing.1-to-normal-form.expects :only [expect?
+ [midje.parsing.1-to-explicit-form.expects :only [expect?
wrap-with-expect__then__at-rightmost-expect-leaf]]
[midje.parsing.util.file-position :only [annotate-embedded-arrows-with-line-numbers]]
[midje.parsing.util.wrapping :only [already-wrapped?
multiwrap
with-additional-wrappers
forms-to-wrap-around]]
[midje.util.debugging :only [nopret]]
- [midje.parsing.1-to-normal-form.prerequisites :only [head-of-form-providing-prerequisites?
+ [midje.parsing.1-to-explicit-form.prerequisites :only [head-of-form-providing-prerequisites?
insert-prerequisites-into-expect-form-as-fakes]]
[midje.parsing.util.arrows :only [start-of-checking-arrow-sequence? leaves-contain-arrow?]]
- [midje.parsing.1-to-normal-form.background :only [surround-with-background-fakes
+ [midje.parsing.1-to-explicit-form.background :only [surround-with-background-fakes
body-of-against-background
against-background-contents-wrappers
against-background-facts-and-checks-wrappers
against-background?]]
- [midje.parsing.1-to-normal-form.metaconstants :only [predefine-metaconstants-from-form]]
+ [midje.parsing.1-to-explicit-form.metaconstants :only [predefine-metaconstants-from-form]]
[midje.util.form-utils :only [def-many-methods first-named? translate-zipper
preserve-type quoted? pred-cond reader-line-number named?]]
[midje.util.laziness :only [eagerly]]
@@ -28,7 +28,7 @@
(:require [clojure.zip :as zip])
(:require [midje.checking.facts :as fact-checking]
[midje.data.compendium :as compendium]
- [midje.parsing.1-to-normal-form.future-facts :as parse-future-facts]
+ [midje.parsing.1-to-explicit-form.future-facts :as parse-future-facts]
[midje.parsing.2-to-lexical-maps.folded-fakes :as parse-folded-fakes]
[midje.data.fact :as fact-data]))
View
4 ...parsing/1_to_normal_form/future_facts.clj → ...rsing/1_to_explicit_form/future_facts.clj
@@ -1,9 +1,9 @@
(ns ^{:doc "Parsing future-facts."}
- midje.parsing.1-to-normal-form.future-facts
+ midje.parsing.1-to-explicit-form.future-facts
(:use [midje.util.form-utils :only [macro-for first-named? reader-line-number]])
(:require [midje.parsing.util.file-position :as position]
[midje.data.nested-facts :as nested-facts]
- [midje.parsing.1-to-normal-form.metadata :as parse-metadata]
+ [midje.parsing.1-to-explicit-form.metadata :as parse-metadata]
[midje.emission.api :as emit]))
(def future-prefixes ["future-"
View
2 ...arsing/1_to_normal_form/metaconstants.clj → ...sing/1_to_explicit_form/metaconstants.clj
@@ -1,5 +1,5 @@
(ns ^{:doc "Transforming code in a way that produces metaconstants"}
- midje.parsing.1-to-normal-form.metaconstants
+ midje.parsing.1-to-explicit-form.metaconstants
(:require [midje.data.metaconstant :as data])
(:import midje.data.metaconstant.Metaconstant))
View
2 ...dje/parsing/1_to_normal_form/metadata.clj → ...e/parsing/1_to_explicit_form/metadata.clj
@@ -1,5 +1,5 @@
(ns ^{:doc "Parsing metadata as found in facts, around-facts, and tables"}
- midje.parsing.1-to-normal-form.metadata
+ midje.parsing.1-to-explicit-form.metadata
(:use [midje.error-handling.exceptions :only [user-error]]
clojure.pprint)
(:require [midje.parsing.util.arrows :as arrows]))
View
4 ...arsing/1_to_normal_form/prerequisites.clj → ...sing/1_to_explicit_form/prerequisites.clj
@@ -1,11 +1,11 @@
(ns ^{:doc "Functions for turning provideds into semi-sweet fakes"}
- midje.parsing.1-to-normal-form.prerequisites
+ midje.parsing.1-to-explicit-form.prerequisites
(:use [midje.util.namespace :only [matches-symbols-in-semi-sweet-or-sweet-ns?]]
[midje.util.form-utils :only [symbol-named?]]
[midje.parsing.util.file-position :only [arrow-line-number-from-form]]
midje.parsing.arrow-symbols
[midje.parsing.util.arrows :only [pull-all-arrow-seqs-from]]
- [midje.parsing.1-to-normal-form.expects :only [up-to-full-expect-form expect?
+ [midje.parsing.1-to-explicit-form.expects :only [up-to-full-expect-form expect?
tack-on__then__at-rightmost-expect-leaf]])
(:require [clojure.zip :as zip]
[midje.util.ecosystem :as ecosystem]))
View
2 src/midje/parsing/2_to_lexical_maps/data_fakes.clj
@@ -4,7 +4,7 @@
[midje.util.object-utils :only [object-name]]
[midje.checkers :only [exactly]]
[midje.checking.checkers.defining :only [checker? checker-makers]]
- [midje.parsing.1-to-normal-form.expects :only [expect? up-to-full-expect-form]]
+ [midje.parsing.1-to-explicit-form.expects :only [expect? up-to-full-expect-form]]
[midje.util.form-utils :only [first-named? translate-zipper map-difference
hash-map-duplicates-ok pred-cond
quoted-list-form? extended-fn?]]
View
2 src/midje/parsing/2_to_lexical_maps/examples.clj
@@ -4,7 +4,7 @@
[midje.util.object-utils :only [object-name]]
[midje.checkers :only [exactly]]
[midje.checking.checkers.defining :only [checker? checker-makers]]
- [midje.parsing.1-to-normal-form.expects :only [expect? up-to-full-expect-form]]
+ [midje.parsing.1-to-explicit-form.expects :only [expect? up-to-full-expect-form]]
[midje.util.form-utils :only [first-named? translate-zipper map-difference
hash-map-duplicates-ok pred-cond
quoted-list-form? extended-fn?
View
2 src/midje/parsing/2_to_lexical_maps/fakes.clj
@@ -4,7 +4,7 @@
[midje.util.object-utils :only [object-name]]
[midje.checkers :only [exactly]]
[midje.checking.checkers.defining :only [checker? checker-makers]]
- [midje.parsing.1-to-normal-form.expects :only [expect? up-to-full-expect-form]]
+ [midje.parsing.1-to-explicit-form.expects :only [expect? up-to-full-expect-form]]
[midje.util.form-utils :only [first-named? translate-zipper map-difference
hash-map-duplicates-ok pred-cond
quoted-list-form? extended-fn?]]
View
2 src/midje/parsing/2_to_lexical_maps/folded_fakes.clj
@@ -7,7 +7,7 @@
)
(:require
[clojure.zip :as zip]
- [midje.parsing.1-to-normal-form.expects :as expects]
+ [midje.parsing.1-to-explicit-form.expects :as expects]
[midje.parsing.util.fnref :as fnref]
)
)
View
64 src/midje/parsing/README.md
@@ -1,51 +1,53 @@
-Midje parsing generates different kinds of maps that drive
-checking. For reference, the maps are gathered together in
+The core of midje is one function and a few different kinds
+of maps. The parsing code is organized around the maps, and
+the function comes along for the ride.
+
+For reference, the maps are gathered together in
`lexical_maps.clj` in this directory. Partly for historical
reasons, parsing is a 3 step process, each step represented
by one of the `1_*`, `2_*`, and `3_*` directories. (The
`0_*` directory will be explained later.)
-## Step 1: Converting from unclojurian to more clojurian syntax.
+## Step 1: Converting from implicit to explicit form
-Midje is notable (and, in some circles, notably disliked)
-for having a syntax that's not nicely nested in the normal
-Lispy way. For example, individual examples are not enclosed by
-parens, and they don't start with a function name or similar
-token.
+Midje facts are built around the ideas of examples and
+prerequisites. In normal Lispy style, you'd expect those
+ideas to be reified into the names of functions or macros,
+and you'd expect to see code forms like this:
```clojure
- (fact
- (+ 1 1) => 2 ; The arrow is significant for parsing.
- (+ 2 2) => 4)
+ (example ... )
+ (prerequisite ...)
```
-Files in `1_to_normal_form` convert from Midje syntax to a
-more Lispy syntax. Specifically, examples are converted into
-a form like this:
+Midje instead uses an implicit syntax. When you see a form
+like this:
```clojure
- (expect (+ 1 1) => 2)
+ (facts "about my-fun"
+ (myfun 3) => 4
+ (myfun -1) => 4
+ (provided
+ (helper 1) => 2
+ (helper 2) => 2))
```
-While still a macro, `expect` looks more like Lisp.
-(The arrow is not just decoration, since different forms of
-arrows affect what kind of check is done.)
-
-Prerequisites are inserted as additional clauses within the arrow
-form. So this example:
-
-```clojure
- (fact
- (f 1) => 2
- (provided
- (g 1) => 3))
-```
+... you know there are two examples, the second of which
+identifies two calls to a single prerequisite
+(`helper`). But the words don't appear. You infer that from
+a non-Lispy syntax.
-... becomes this:
+This step in parsing converts those implicit forms into
+explicit ones. (For historical reasons, the names don't match
+current Midje terminology.) Here are the explicit forms from
+the above fact:
```clojure
- (expect (f 1) => 2
- (fake (g 1) => 3))
+ ...
+ (expect (myfun 3) => 4)
+ (expect (myfun -1 => 4 (fake (helper 1) => 2)
+ (fake (helper 2) => 2)))
+ ...
```
## Step 2: Converting into lexical maps
View
10 src/midje/sweet.clj
@@ -15,13 +15,13 @@
[midje.util.form-utils :only [macro-for]]
[midje.parsing.util.wrapping :only [put-wrappers-into-effect]]
[midje.parsing.util.file-position :only [set-fallback-line-number-from]]
- [midje.parsing.1-to-normal-form.facts :only [complete-fact-transformation
+ [midje.parsing.1-to-explicit-form.facts :only [complete-fact-transformation
midjcoexpand]]
[clojure.algo.monads :only [domonad]])
- (:require [midje.parsing.1-to-normal-form.background :as background]
- [midje.parsing.1-to-normal-form.metadata :as parse-metadata]
- [midje.parsing.1-to-normal-form.future-facts :as parse-future-fact]
- [midje.parsing.1-to-normal-form.metaconstants :as parse-metaconstants]
+ (:require [midje.parsing.1-to-explicit-form.background :as background]
+ [midje.parsing.1-to-explicit-form.metadata :as parse-metadata]
+ [midje.parsing.1-to-explicit-form.future-facts :as parse-future-fact]
+ [midje.parsing.1-to-explicit-form.metaconstants :as parse-metaconstants]
[midje.parsing.0-to-fact-form.tabular :as tabular]
[midje.parsing.0-to-fact-form.formulas :as parse-formulas]
[midje.emission.api :as emit]
View
2 test/midje/parsing/0_to_fact_form/t_tabular.clj
@@ -5,7 +5,7 @@
[midje sweet test-util]
[ordered.map :only (ordered-map)]
midje.util)
- (:require [midje.parsing.1-to-normal-form.facts :as facts]
+ (:require [midje.parsing.1-to-explicit-form.facts :as facts]
[midje.config :as config]))
(expose-testables midje.parsing.0-to-fact-form.tabular)
View
8 ...parsing/1_to_normal_form/t_background.clj → ...rsing/1_to_explicit_form/t_background.clj
@@ -1,13 +1,13 @@
-(ns midje.parsing.1-to-normal-form.t-background
+(ns midje.parsing.1-to-explicit-form.t-background
(:require [clojure.zip :as zip])
(:use [midje sweet test-util]
[midje.parsing.util.wrapping :only [for-wrapping-target?]]
[midje.util unify]
[midje.error-handling validation-errors]
- [midje.parsing.1-to-normal-form.background :only [separate-background-forms setup-teardown-bindings
+ [midje.parsing.1-to-explicit-form.background :only [separate-background-forms setup-teardown-bindings
seq-headed-by-setup-teardown-form? background-wrappers]]
midje.util))
-(expose-testables midje.parsing.1-to-normal-form.background)
+(expose-testables midje.parsing.1-to-explicit-form.background)
(unfinished unused used)
(defn calls-nothing [] )
@@ -113,7 +113,7 @@
;; a fact because it gets substituted. So we let the caller use "danger" instead.
(letfn [(form-matching? [expected]
(fn [actual] (= actual
- (substitute expected {'?danger 'midje.parsing.1-to-normal-form.t-background/?form}))))]
+ (substitute expected {'?danger 'midje.parsing.1-to-explicit-form.t-background/?form}))))]
(fact "canonicalized setup/teardown wrappers can be put into final form"
(let [final (state-wrapper '(before :checks (do-something)))]
View
4 ...je/parsing/1_to_normal_form/t_expects.clj → .../parsing/1_to_explicit_form/t_expects.clj
@@ -1,5 +1,5 @@
-(ns midje.parsing.1-to-normal-form.t-expects
- (:use [midje.parsing.1-to-normal-form.expects]
+(ns midje.parsing.1-to-explicit-form.t-expects
+ (:use [midje.parsing.1-to-explicit-form.expects]
[midje.parsing.util.arrows :only [start-of-checking-arrow-sequence?]]
midje.sweet
midje.test-util)
View
4 ...idje/parsing/1_to_normal_form/t_facts.clj → ...je/parsing/1_to_explicit_form/t_facts.clj
@@ -1,5 +1,5 @@
-(ns midje.parsing.1-to-normal-form.t-facts
- (:use midje.parsing.1-to-normal-form.facts
+(ns midje.parsing.1-to-explicit-form.t-facts
+ (:use midje.parsing.1-to-explicit-form.facts
midje.sweet midje.test-util)
(:require [clojure.zip :as zip]
[midje.config :as config]))
View
4 ...sing/1_to_normal_form/t_metaconstants.clj → ...ng/1_to_explicit_form/t_metaconstants.clj
@@ -1,5 +1,5 @@
-(ns midje.parsing.1-to-normal-form.t-metaconstants
- (:use midje.parsing.1-to-normal-form.metaconstants
+(ns midje.parsing.1-to-explicit-form.t-metaconstants
+ (:use midje.parsing.1-to-explicit-form.metaconstants
[midje sweet test-util]
clojure.pprint)
(:import midje.data.metaconstant.Metaconstant))
View
8 ...e/parsing/1_to_normal_form/t_metadata.clj → ...parsing/1_to_explicit_form/t_metadata.clj
@@ -1,7 +1,7 @@
-(ns midje.parsing.1-to-normal-form.t-metadata
+(ns midje.parsing.1-to-explicit-form.t-metadata
(:use midje.sweet
midje.test-util
- midje.parsing.1-to-normal-form.metadata))
+ midje.parsing.1-to-explicit-form.metadata))
(def a-body '((f) => 3))
@@ -10,8 +10,8 @@
(let [[meta _] (separate-metadata `(fact "doc" ~@a-body))]
(:midje/source meta) => `(fact "doc" ~@a-body)
(:midje/body-source meta) => a-body
- (:midje/file meta) => "midje/parsing/1_to_normal_form/t_metadata.clj"
- (:midje/namespace meta) => 'midje.parsing.1-to-normal-form.t-metadata
+ (:midje/file meta) => "midje/parsing/1_to_explicit_form/t_metadata.clj"
+ (:midje/namespace meta) => 'midje.parsing.1-to-explicit-form.t-metadata
(contains? meta :midje/line) => truthy))
View
6 ...sing/1_to_normal_form/t_prerequisites.clj → ...ng/1_to_explicit_form/t_prerequisites.clj
@@ -1,8 +1,8 @@
-(ns midje.parsing.1-to-normal-form.t-prerequisites
- (:use midje.parsing.1-to-normal-form.prerequisites
+(ns midje.parsing.1-to-explicit-form.t-prerequisites
+ (:use midje.parsing.1-to-explicit-form.prerequisites
midje.sweet midje.test-util)
(:require [clojure.zip :as zip]
- [midje.parsing.1-to-normal-form.expects :as parse-expects]))
+ [midje.parsing.1-to-explicit-form.expects :as parse-expects]))
(fact "can ask whether at the beginning of a form that provides prerequisites"
(let [values (zip/seq-zip '(provided midje.semi-sweet/provided fluke))]
View
22 test/midje/t_repl.clj
@@ -119,7 +119,7 @@
;;; Note that facts must be returned in alphetical order by namespace,
;;; then by creation order within namespace.
- (add-fact :midje/namespace 'midje.parsing.1-to-normal-form.facts :midje/name "f - second - midje.parsing.1-to-normal-form.facts")
+ (add-fact :midje/namespace 'midje.parsing.1-to-explicit-form.facts :midje/name "f - second - midje.parsing.1-to-explicit-form.facts")
(add-fact :midje/namespace 'midje.t-repl :midje/name "m - fourth - midje.t-repl")
(add-fact :midje/namespace 'midje.repl :midje/name "p - third - midje.repl" )
(add-fact :midje/namespace 'midje.t-repl :midje/name "a - fifth - midje.t-repl")
@@ -132,29 +132,29 @@
(names (fetch-facts)) => expected
(names (fetch-facts)) => expected)
- (let [expected ["f - second - midje.parsing.1-to-normal-form.facts"]]
- (names (fetch-facts 'midje.parsing.1-to-normal-form.facts)) => expected
+ (let [expected ["f - second - midje.parsing.1-to-explicit-form.facts"]]
+ (names (fetch-facts 'midje.parsing.1-to-explicit-form.facts)) => expected
(names (fetch-facts)) => expected)
;; if explicit namespace order is given, it's obeyed
(let [expected ["m - fourth - midje.t-repl" "a - fifth - midje.t-repl" "z - first - integration" ]]
(names (fetch-facts 'midje.t-repl 'midje.config)) => expected
(names (fetch-facts)) => expected)
- (let [expected ["z - first - integration" "f - second - midje.parsing.1-to-normal-form.facts" "p - third - midje.repl" "m - fourth - midje.t-repl" "a - fifth - midje.t-repl"]]
+ (let [expected ["z - first - integration" "f - second - midje.parsing.1-to-explicit-form.facts" "p - third - midje.repl" "m - fourth - midje.t-repl" "a - fifth - midje.t-repl"]]
(names (fetch-facts :all)) => expected
(names (fetch-facts)) => expected)
- (let [expected ["z - first - integration" "f - second - midje.parsing.1-to-normal-form.facts"]]
+ (let [expected ["z - first - integration" "f - second - midje.parsing.1-to-explicit-form.facts"]]
(names (fetch-facts :all "n")) => expected
(names (fetch-facts)) => expected)
- (names (fetch-facts 'midje.parsing.1-to-normal-form.facts #"q")) => []
+ (names (fetch-facts 'midje.parsing.1-to-explicit-form.facts #"q")) => []
(names (fetch-facts :all :integration)) => ["z - first - integration"]
(names (fetch-facts *ns* :integration)) => []
(names (fetch-facts :all #(= (:midje/name %) "p - third - midje.repl"))) => ["p - third - midje.repl"]
- (names (fetch-facts "midje.parsing.1-to-normal-form.facts" "p - third - midje.repl" :all))
- => ["f - second - midje.parsing.1-to-normal-form.facts" "p - third - midje.repl"]
+ (names (fetch-facts "midje.parsing.1-to-explicit-form.facts" "p - third - midje.repl" :all))
+ => ["f - second - midje.parsing.1-to-explicit-form.facts" "p - third - midje.repl"]
)
@@ -224,7 +224,7 @@
:check-only-at-load-time
(fact "it can get its default from load-facts"
(forget-facts :all)
- (add-fact :midje/namespace 'midje.parsing.1-to-normal-form.facts :midje/name "not forgotten")
+ (add-fact :midje/namespace 'midje.parsing.1-to-explicit-form.facts :midje/name "not forgotten")
(load-facts 'midje.t-repl-helper :print-nothing)
(forget-facts)
(map fact-name (compendium/all-facts<>)) => ["not forgotten"])
@@ -240,8 +240,8 @@
(fact "forget-facts does not affect check-facts"
(forget-facts :all)
(load-facts 'midje.t-repl-helper :non-featherian :print-nothing)
- (add-fact :midje/namespace 'midje.parsing.1-to-normal-form.facts)
- (forget-facts 'midje.parsing.1-to-normal-form.facts)
+ (add-fact :midje/namespace 'midje.parsing.1-to-explicit-form.facts)
+ (forget-facts 'midje.parsing.1-to-explicit-form.facts)
(map fact-name (fetch-facts)) => ["a non-featherian test"]))
)

0 comments on commit 01b1447

Please sign in to comment.
Something went wrong with that request. Please try again.