Permalink
Browse files

Change TODO syntax

* Provide TODO as a function.
* Remove it-TODO syntax.
  • Loading branch information...
1 parent 412ba89 commit d239376ad20edd12e10c483bb03de91dee4f03c7 @kana committed Nov 6, 2011
Showing with 16 additions and 10 deletions.
  1. +4 −2 t/it-syntax.t
  2. +12 −8 test/gasmine.scm
View
@@ -81,8 +81,10 @@
(lambda ()
(parameterize ([all-suites '()])
(describe "-"
- (it "should succeed" TODO)
- (it "should succeed" TODO "known breakage"))
+ (it "should succeed"
+ (TODO))
+ (it "should succeed"
+ (TODO "known breakage")))
(run-suites))))
equal?
(unlines "not ok 1 - # TODO should succeed"
View
@@ -2,6 +2,7 @@
(export
; Public API
SKIP
+ TODO
after
before
describe
@@ -105,12 +106,6 @@
(define-syntax it
(syntax-rules (TODO)
- [(_ description TODO)
- (it (format "# TODO ~a" description)
- (stop-running-this-spec :todo #t))]
- [(_ description TODO message)
- (it (format "# TODO ~a (~a)" description message)
- (stop-running-this-spec :todo #t))]
[(_ description body ...)
(slot-push! (current-suite)
'specs
@@ -123,6 +118,11 @@
:skip #t
:message message))
+(define (TODO :optional message)
+ (stop-running-this-spec
+ :todo #t
+ :message message))
+
(define-syntax before
(syntax-rules ()
[(_ body ...)
@@ -209,10 +209,14 @@
maybe-error))
(if (get :todo more-info)
(format #t
- "~a ~a - ~a\n"
+ "~a ~a - # TODO ~a~a\n"
"not ok"
test-count
- description)
+ description
+ (let1 message (get :message more-info)
+ (if (undefined? message)
+ ""
+ (format " (~a)" message))))
(format #t
(string-join
'("~a ~a - ~a"

0 comments on commit d239376

Please sign in to comment.