clucumber 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,8 @@
6
6
  #:Given* #:When* #:Then*
7
7
  #:Before #:After
8
8
  #:pending #:fail
9
- #:var)
9
+ #:var
10
+ #:table-equal)
10
11
  (:use #:cl #:cl-interpol))
11
12
 
12
13
  (cl:defpackage #:clucumber-user
@@ -31,15 +31,17 @@
31
31
  :key (lambda (path)
32
32
  (enough-namestring path base-pathname))))))))
33
33
 
34
- (defun serve-cucumber-requests (socket &aux (stream (socket-stream socket)))
34
+ (defvar *stream*)
35
+
36
+ (defun serve-cucumber-requests (socket &aux (*stream* (socket-stream socket)))
35
37
  (handler-case
36
38
  (loop
37
- (let* ((line (read-line stream))
39
+ (let* ((line (read-line *stream*))
38
40
  (message (read-json line nil))
39
41
  (reply (call-wire-protocol-method message)))
40
- (st-json:write-json reply stream)
41
- (terpri stream)
42
- (finish-output stream)))
42
+ (st-json:write-json reply *stream*)
43
+ (terpri *stream*)
44
+ (finish-output *stream*)))
43
45
  (end-of-file nil nil)))
44
46
 
45
47
 
@@ -240,3 +242,12 @@
240
242
 
241
243
  (defun reset-state ()
242
244
  (clrhash *variables*))
245
+
246
+ ;;; Table diffing:
247
+
248
+ (defun clucumber-steps:table-equal (expected actual)
249
+ (st-json:write-json (list "diff" (list expected actual)) *stream*)
250
+ (terpri *stream*)
251
+ (finish-output *stream*)
252
+ (let ((reply-line (read-line *stream*)))
253
+ (string= "diff_ok" (first (read-json reply-line nil)))))
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clucumber
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andreas Fuchs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-11 00:00:00 +02:00
18
+ date: 2010-07-13 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency