Permalink
Browse files

Clean up ansi mess.

  • Loading branch information...
magnars committed Dec 19, 2012
1 parent 54f0681 commit ba7d8dafbad2b2f1d121fd9e6c68b7515416539d
View
@@ -68,11 +68,18 @@
(define-key buster-mode-map
(kbd "C-c C-b ra") 'buster-run-all-tests)
(defun buster-mode--clean-up-ansi-mess (&rest ignore)
(with-current-buffer "*compilation*"
(save-excursion
(goto-char (point-min))
(while (search-forward "" nil t)
(delete-char -5)
(delete-char (- (current-column)))))))
(define-minor-mode buster-mode
"Buster mode"
nil
" Buster"
buster-mode-map)
"Buster mode" nil " Buster" buster-mode-map
(when buster-mode
(add-hook 'compilation-finish-functions 'buster-mode--clean-up-ansi-mess)))
(provide 'buster-mode)
@@ -6,4 +6,5 @@ Feature: Run all tests
And I press "C-c C-b ra"
And I wait for the compilation to finish
And I switch to buffer "*compilation*"
Then I should see "0 timeouts"
Then I should see "17 tests, 19 assertions, 1 runtime ... OK"
And I should not see ""
@@ -29,4 +29,4 @@
(And "^I have passing tests$"
(lambda ()
(setq buster-compile-command "./buster-test")))
(setq buster-compile-command "cat features/stubs/passing-tests")))
@@ -0,0 +1,36 @@
Running tests ...
Running 17 tests in 1 runtime ...
Failure: ANSI table draws multi-line cells
[refute.equals] """Something In this
cell
Other There is
stuff
" expected not to be equal to "Something In this
cell
Other There is
stuff
"
at Object.referee.fail (/home/christian/projects/busterjs/modules/referee/lib/referee.js:156:25)
at Object.fail (/home/christian/projects/busterjs/modules/referee/lib/referee.js:43:17)
at Function.referee.(anonymous function).(anonymous function) [as equals] (/home/christian/projects/busterjs/modules/referee/lib/referee.js:86:29)
at Object.buster.testCase.draws multi-line cells (./test/ansi-table-test.js:92:16)
at asyncFunction (/home/christian/projects/busterjs/modules/buster-test/lib/test-runner.js:230:19)
at callTestFn (/home/christian/projects/busterjs/modules/buster-test/lib/test-runner.js:340:27)
at p.then (/home/christian/projects/busterjs/modules/buster-test/node_modules/when/when.js:71:31)
at Object.then (/home/christian/projects/busterjs/modules/buster-test/node_modules/when/when.js:177:11)
at Object.bane.createEventEmitter.runTest (/home/christian/projects/busterjs/modules/buster-test/lib/test-runner.js:608:26)
at Object.bane.createEventEmitter.runTests (/home/christian/projects/busterjs/modules/buster-test/lib/test-runner.js:576:29)
Running 17 tests in 1 runtime ... 6% done
Running 17 tests in 1 runtime ... 12% done
Running 17 tests in 1 runtime ... 12% done
Running 17 tests in 1 runtime ... 35% done
Running 17 tests in 1 runtime ... 35% done
Running 17 tests in 1 runtime ... 47% done
Running 17 tests in 1 runtime ... 47% done
Running 17 tests in 1 runtime ... 53% done
Running 17 tests in 1 runtime ... 53% done
Running 17 tests in 1 runtime ... 59% done
Running 17 tests in 1 runtime ... 59% done
Running 17 tests in 1 runtime ... 88% done
Running 17 tests in 1 runtime ... 88% done
17 tests, 18 assertions, 1 runtime ... 1 failure
@@ -0,0 +1,15 @@
Running tests ...
Running 17 tests in 1 runtime ...
Running 17 tests in 1 runtime ... 12% done
Running 17 tests in 1 runtime ... 12% done
Running 17 tests in 1 runtime ... 18% done
Running 17 tests in 1 runtime ... 18% done
Running 17 tests in 1 runtime ... 35% done
Running 17 tests in 1 runtime ... 35% done
Running 17 tests in 1 runtime ... 47% done
Running 17 tests in 1 runtime ... 47% done
Running 17 tests in 1 runtime ... 76% done
Running 17 tests in 1 runtime ... 76% done
Running 17 tests in 1 runtime ... 82% done
Running 17 tests in 1 runtime ... 82% done
17 tests, 19 assertions, 1 runtime ... OK

0 comments on commit ba7d8da

Please sign in to comment.