| 1 | #include <cgreen/cgreen.h> |
| 2 | #include <cgreen/mocks.h> |
| 3 | |
| 4 | #include "stream.h" |
| 5 | |
| 6 | Describe(Formatter); |
| 7 | BeforeEach(Formatter) {} |
| 8 | AfterEach(Formatter) {} |
| 9 | |
| 10 | int one_character_stream(void *stream) { return 'a'; } |
| 11 | |
| 12 | void expect_one_letter_paragraph(void *stream, char *paragraph) { |
| 13 | assert_that(paragraph, is_equal_to_string("a")); |
| 14 | } |
| 15 | |
| 16 | Ensure(Formatter, makes_one_letter_paragraph_from_one_character_input) { |
| 17 | by_paragraph( |
| 18 | &one_character_stream, |
| 19 | NULL, |
| 20 | &expect_one_letter_paragraph, |
| 21 | NULL); |
| 22 | } |