Skip to content

Instantly share code, notes, and snippets.

@dbriones
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbriones/eae041030c8834647aa6 to your computer and use it in GitHub Desktop.
Save dbriones/eae041030c8834647aa6 to your computer and use it in GitHub Desktop.
moving-time-window retains state across tests
(streams
(moving-time-window 10
(tap :mtw
#(info %))))
(tests
(let [input {:service "some-service"}]
(deftest moving-time-window-should-not-retain-state-between-tests
(is (= (inject! [input])
{:mtw [[input]]})))
(deftest moving-time-window-should-accumulate-events
(is (= (inject! [input])
{:mtw [[input]]})))))
@dbriones
Copy link
Author

dbriones commented Aug 5, 2014

16:50:51 powerhaus riemann-0.2.6 $ bin/riemann test etc/moving-time-window-should-not-retain-state.config 
loading bin

Testing riemann.config-test
INFO [2014-08-05 16:53:08,410] main - riemann.config - nil
INFO [2014-08-05 16:53:08,418] main - riemann.config - nil

FAIL in (moving-time-window-should-accumulate-events) (moving-time-window-should-not-retain-state.config:10)
expected: (= (inject! [input]) {:mtw [[input]]})
  actual: (not (= {:mtw [[{:service "some-service"} {:service "some-service"}]]} {:mtw [[{:service "some-service"}]]}))

Ran 2 tests containing 2 assertions.
1 failures, 0 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment