summaryrefslogtreecommitdiff
path: root/test/test_wrapper.rb
diff options
context:
space:
mode:
authorAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-03-13 18:49:50 -0300
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-04-29 23:43:25 -0300
commit28ea6e726b9d9257e428bf91d98a0a7c5f266200 (patch)
tree5984bd3ba691217a5d2858ae5ce507d19e140bec /test/test_wrapper.rb
parent753eb608b5e7ac1117a0da64252f3c583c3a8178 (diff)
downloadhighline-28ea6e726b9d9257e428bf91d98a0a7c5f266200.tar.gz
Split two different case in their own assertions (HighLine::Wrapper)
Diffstat (limited to 'test/test_wrapper.rb')
-rw-r--r--test/test_wrapper.rb47
1 files changed, 28 insertions, 19 deletions
diff --git a/test/test_wrapper.rb b/test/test_wrapper.rb
index c52888f..c585969 100644
--- a/test/test_wrapper.rb
+++ b/test/test_wrapper.rb
@@ -17,25 +17,34 @@ class TestHighLine < Minitest::Test
@output.truncate(@output.rewind)
- @terminal.say( "This is a long flowing paragraph meant to span " +
- "several lines. This text should definitely be " +
- "wrapped at the set limit, in the result. Your code " +
- "does well with things like this.\n\n" +
- " * This is a simple embedded list.\n" +
- " * You're code should not mess with this...\n" +
- " * Because it's already formatted correctly and " +
- "does not\n" +
- " exceed the limit!" )
- assert_equal( "This is a long flowing paragraph meant to span " +
- "several lines. This text should\n" +
- "definitely be wrapped at the set limit, in the " +
- "result. Your code does well with\n" +
- "things like this.\n\n" +
- " * This is a simple embedded list.\n" +
- " * You're code should not mess with this...\n" +
- " * Because it's already formatted correctly and does " +
- "not\n" +
- " exceed the limit!\n", @output.string )
+ long_line =
+ "This is a long flowing paragraph meant to span " +
+ "several lines. This text should definitely be " +
+ "wrapped at the set limit, in the result. Your code " +
+ "does well with things like this.\n\n"
+
+ wrapped_long_line =
+ "This is a long flowing paragraph meant to span " +
+ "several lines. This text should\n" +
+
+ "definitely be wrapped at the set limit, in the " +
+ "result. Your code does well with\n" +
+
+ "things like this.\n\n"
+
+ @terminal.say long_line
+ assert_equal wrapped_long_line, @output.string
+
+ @output.truncate(@output.rewind)
+
+ well_formatted_text =
+ " * This is a simple embedded list.\n" +
+ " * You're code should not mess with this...\n" +
+ " * Because it's already formatted correctly and does not\n" +
+ " exceed the limit!\n"
+
+ @terminal.say well_formatted_text
+ assert_equal well_formatted_text, @output.string
@output.truncate(@output.rewind)