Permalink
Browse files

Consolidated namespace utils

  • Loading branch information...
1 parent de136a0 commit 045633996dc2addb9c61a46fd584e8b52f5ee9cf @marick committed Jan 26, 2013
@@ -1,8 +1,8 @@
(ns ^{:doc "Validation methods confirming the proper syntax of semi-sweet macros."}
midje.error-handling.semi-sweet-validations
(:use midje.clojure.core
+ midje.parsing.util.core
[midje.error-handling.validation-errors :only [validation-error-report-form validate]]
- [midje.util.namespace :only [matches-symbols-in-semi-sweet-or-sweet-ns?]]
[midje.data.metaconstant :only [metaconstant-symbol?]]
[midje.parsing.arrow-symbols :only [=contains=>]])
(:require [midje.parsing.util.fnref :as fnref]))
@@ -1,8 +1,7 @@
(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-explicit-form.expects
- (:use midje.parsing.util.form-utils
- [midje.util.namespace :only [matches-symbols-in-semi-sweet-or-sweet-ns?]]
+ (:use midje.parsing.util.core
[midje.util.form-utils :only [first-named?]]
[midje.parsing.util.zip :only [skip-to-rightmost-leaf n-times remove-moving-right]]
[midje.parsing.util.arrows :only [start-of-checking-arrow-sequence? arrow-sequence-overrides]]
@@ -1,8 +1,8 @@
(ns ^{:doc "Parsing facts."}
midje.parsing.1-to-explicit-form.facts
(:use midje.clojure.core
+ midje.parsing.util.core
[midje.error-handling.validation-errors :only [validate when-valid]]
- [midje.util.namespace :only [semi-sweet-keyword?]]
[midje.parsing.1-to-explicit-form.expects :only [expect?
wrap-with-expect__then__at-rightmost-expect-leaf]]
@@ -1,6 +1,6 @@
(ns ^{:doc "Functions for turning provideds into semi-sweet fakes"}
midje.parsing.1-to-explicit-form.prerequisites
- (:use [midje.util.namespace :only [matches-symbols-in-semi-sweet-or-sweet-ns?]]
+ (:use midje.parsing.util.core
[midje.util.form-utils :only [symbol-named?]]
[midje.parsing.util.file-position :only [arrow-line-number-from-form]]
midje.parsing.arrow-symbols
@@ -1,6 +1,7 @@
(ns ^{:doc "generate a map for a particular example"}
midje.parsing.2-to-lexical-maps.examples
(:use midje.clojure.core
+ midje.parsing.util.core
[midje.util.object-utils :only [object-name]]
[midje.checkers :only [exactly]]
[midje.checking.checkers.defining :only [checker? checker-makers]]
@@ -11,7 +12,6 @@
def-many-methods ]]
[midje.checking.extended-equality :only [extended-= extended-list-=]]
[midje.parsing.util.file-position :only [user-file-position]]
- [midje.util.namespace :only [semi-sweet-keyword?]]
[midje.util.thread-safe-var-nesting :only [namespace-values-inside-out
with-altered-roots]]
[midje.parsing.util.wrapping :only [with-wrapping-target]]
@@ -1,9 +1,9 @@
(ns ^{:doc "Arrows either indicate a form of expected result, or a prerequisite value."}
midje.parsing.util.arrows
(:use midje.clojure.core
+ midje.parsing.util.core
midje.parsing.arrow-symbols
- midje.parsing.util.form-utils
- [midje.util form-utils namespace])
+ [midje.util form-utils])
(:require [clojure.zip :as zip]))
;; Arrow groupings
@@ -1,9 +1,16 @@
-(ns midje.util.namespace
+(ns ^{:doc "Utility functions dealing with checking or tranforming forms or zippers."}
+ midje.parsing.util.core
(:use midje.clojure.core
- midje.parsing.util.form-utils)
+ [utilize.seq :only (first-truthy-fn)])
(:require [clojure.zip :as zip]))
+(defn tree-variant [treelike]
+ (letfn [(is-zipper? [treelike]
+ (:zip/make-node (meta treelike)))]
+ (if (is-zipper? treelike) :zipper :form)))
+
+
(defmulti matches-symbols-in-semi-sweet-or-sweet-ns? (fn [_symbols_ treelike] (tree-variant treelike)))
(defmethod matches-symbols-in-semi-sweet-or-sweet-ns? :zipper [symbols loc]
@@ -1,9 +1,9 @@
(ns ^{:doc "Functions to help in finding the lines you care about."}
midje.parsing.util.file-position
- (:use [clojure.string :only [split]]
+ (:use midje.parsing.util.core
+ [clojure.string :only [split]]
[midje.parsing.util.zip :only [skip-to-rightmost-leaf]]
[midje.util.form-utils :only [quoted? translate-zipper]]
- [midje.util.namespace :only [matches-symbols-in-semi-sweet-or-sweet-ns?]]
[midje.parsing.util.arrows :only [all-arrows at-arrow__add-key-value-to-end__no-movement]])
(:require [clojure.zip :as zip]))
@@ -1,11 +0,0 @@
-(ns ^{:doc "Utility functions dealing with checking or tranforming forms or zippers."}
- midje.parsing.util.form-utils
- (:use midje.clojure.core
- [utilize.seq :only (first-truthy-fn)])
- (:require [clojure.zip :as zip]))
-
-
-(defn tree-variant [treelike]
- (letfn [(is-zipper? [treelike]
- (:zip/make-node (meta treelike)))]
- (if (is-zipper? treelike) :zipper :form)))
View
@@ -8,7 +8,6 @@
midje.error-handling.validation-errors
midje.error-handling.semi-sweet-validations
[midje.error-handling.exceptions :only [user-error]]
- [midje.util.namespace :only [semi-sweet-keyword?]]
[midje.util.ecosystem :only [line-separator]]
[midje.parsing.util.file-position :only [user-file-position]]
midje.production-mode
@@ -1,8 +1,8 @@
(ns ^{:doc "Utility functions dealing with checking or tranforming forms."}
midje.util.form-utils
(:use midje.clojure.core
- [midje.parsing.util.form-utils]
- [utilize.seq :only (first-truthy-fn)])
+ midje.parsing.util.core
+ [utilize.seq :only (first-truthy-fn)])
(:require [clojure.zip :as zip]))
@@ -1,5 +1,5 @@
-(ns midje.util.t-namespace
- (:use midje.util.namespace
+(ns midje.parsing.util.t-core
+ (:use midje.parsing.util.core
midje.sweet
midje.test-util)
(:require [clojure.zip :as zip]))

0 comments on commit 0456339

Please sign in to comment.