- Коректно
- 15 успешни тест(а)
- 0 неуспешни тест(а)
............... Finished in 0.01294 seconds 15 examples, 0 failures
Срокът за предаване на решения е отминал
Едно от нещата, които се използват навсякъде в софтуера, е разделянето на дълъг едноредов текст на множество редове. Виждате го във всеки сайт, в любимия си текстов редактор, IM и т.н. Разбира се, обикновено не ви се налага да си го пишете сами.
Проблемът е доста стар и доста труден, защото зависи от шрифта, големината на всяка от буквите, разстоянията между тях, символите, по които могат да се разделят редове, и езика на текста.
В това предизвикателство ще направите подобна функция. Целта е да упражните някои от методите на Enumerable, в комбинация с такива от String и с наученото за Ruby до момента.
След като пробвате да напишете един прост алгоритъм за word wrap, ще оцените какво правят програмите, които рендерират текст за нас и какво и получаваме наготово, приемайки го за даденост.
Добавете функция word_wrap към класа String (чрез monkey-patching). Като единствен аргумент на функцията се подава цяло число (по-голямо от нула), което задава максималния брой символи на един ред. Няма ограничение за броя редове, които могат да се получат. Възможно е някои от редовете да са по-къси от ограничението. Възможно е в резултата да има и редове, надвишаващи ограничението, ако в тях не е имало къде да се направи line break.
Резултатът от функцията трябва да е масив от низове, всеки елемент на който представлява отделен ред. Ако в текста няма символи, различни от празно място и нов ред, да се върне празен масив.
Разбира се, за опростение на задачата, ще наложим следните ограничения върху текста:
.,!?, празни места и нови редове.word wrap, и word \n wrap." \nHow much wood would\na woodchuck chuck if a woodchuck could chuck wood?\n As much as a woodchuck would chuck if a woodchuck could chuck wood.\n\n ".word_wrap(20)`
Резултат:
[
"How much wood would",
"a woodchuck chuck if",
"a woodchuck could",
"chuck wood? As much",
"as a woodchuck would",
"chuck if a woodchuck",
"could chuck wood."
]
Както и в предните предизвикателства - няма да получавате невалидни входни данни.
Примерните тестове се намират в GitHub хранилището с домашните. За информация как да ги изпълните, погледнете README-то на хранилището.
............... Finished in 0.01294 seconds 15 examples, 0 failures
............... Finished in 0.0126 seconds 15 examples, 0 failures
...........F.FF
Failures:
1) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["ne", "re", "ng"]
(compared using ==)
# /tmp/d20141030-18133-10w273/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: ["まつもとさんは", "ubyのおとうさん."]
(compared using ==)
# /tmp/d20141030-18133-10w273/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["gline", "here"]
(compared using ==)
# /tmp/d20141030-18133-10w273/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01858 seconds
15 examples, 3 failures
Failed examples:
rspec /tmp/d20141030-18133-10w273/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-10w273/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-10w273/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
............... Finished in 0.01615 seconds 15 examples, 0 failures
............... Finished in 0.01709 seconds 15 examples, 0 failures
......F....F..F
Failures:
1) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
expected: ["point line", "parallelogram", "cube"]
got: ["point line", "parallelogram cube"]
(compared using ==)
# /tmp/d20141030-18133-12b2mrv/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["", "one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-12b2mrv/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["", "justonelongline", "here"]
(compared using ==)
# /tmp/d20141030-18133-12b2mrv/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01755 seconds
15 examples, 3 failures
Failed examples:
rspec /tmp/d20141030-18133-12b2mrv/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-12b2mrv/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-12b2mrv/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
............... Finished in 0.01243 seconds 15 examples, 0 failures
............... Finished in 0.01478 seconds 15 examples, 0 failures
............... Finished in 0.01623 seconds 15 examples, 0 failures
..........F.F..
Failures:
1) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: ["one more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1ibpedt/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за", "търпението и", "ура за живота!"]
(compared using ==)
# /tmp/d20141030-18133-1ibpedt/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01498 seconds
15 examples, 2 failures
Failed examples:
rspec /tmp/d20141030-18133-1ibpedt/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-1ibpedt/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
....FF.FFF...F.
Failures:
1) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
expected: ["one", "two"]
got: [" one", "two"]
(compared using ==)
# /tmp/d20141030-18133-1u73ebs/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: [" point", "one two"]
(compared using ==)
# /tmp/d20141030-18133-1u73ebs/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: [" one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1u73ebs/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap is not influenced by trailing whitespace
Failure/Error: expect("one more string \n ".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: [" one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1u73ebs/spec.rb:35:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: [" one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1u73ebs/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: [" まつもとさんは", "Rubyのおとうさん."]
(compared using ==)
# /tmp/d20141030-18133-1u73ebs/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01729 seconds
15 examples, 6 failures
Failed examples:
rspec /tmp/d20141030-18133-1u73ebs/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-1u73ebs/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-1u73ebs/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-1u73ebs/spec.rb:34 # String#word_wrap is not influenced by trailing whitespace
rspec /tmp/d20141030-18133-1u73ebs/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-1u73ebs/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
...........F..F
Failures:
1) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["", "one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-d2tqmp/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["", "justonelongline", "here"]
(compared using ==)
# /tmp/d20141030-18133-d2tqmp/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01288 seconds
15 examples, 2 failures
Failed examples:
rspec /tmp/d20141030-18133-d2tqmp/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-d2tqmp/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
............... Finished in 0.01294 seconds 15 examples, 0 failures
............... Finished in 0.01366 seconds 15 examples, 0 failures
.............F.
Failures:
1) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
Timeout::Error:
execution expired
# /tmp/d20141030-18133-n0aycz/solution.rb:13:in `word_wrap'
# /tmp/d20141030-18133-n0aycz/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 1.11 seconds
15 examples, 1 failure
Failed examples:
rspec /tmp/d20141030-18133-n0aycz/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
............... Finished in 0.0133 seconds 15 examples, 0 failures
............F..
Failures:
1) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за търпението", "иура за живота!"]
(compared using ==)
# /tmp/d20141030-18133-rcsq30/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01367 seconds
15 examples, 1 failure
Failed examples:
rspec /tmp/d20141030-18133-rcsq30/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
...FFFFFFFF.FFF
Failures:
1) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
expected: ["one word", "n two", "words"]
got: ["one word n", "two words"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
expected: ["one", "two"]
got: ["one two"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: ["point one"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
expected: ["point line", "parallelogram", "cube"]
got: ["point line parallelogram"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one more"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap is not influenced by trailing whitespace
Failure/Error: expect("one more string \n ".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one more"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:35:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one more"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: ["one more string"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за търпението и"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: ["まつもとさんは Rubyのおとうさん."]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
11) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["justonelongline"]
(compared using ==)
# /tmp/d20141030-18133-96yial/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01954 seconds
15 examples, 11 failures
Failed examples:
rspec /tmp/d20141030-18133-96yial/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-96yial/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-96yial/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-96yial/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-96yial/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-96yial/spec.rb:34 # String#word_wrap is not influenced by trailing whitespace
rspec /tmp/d20141030-18133-96yial/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-96yial/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-96yial/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-96yial/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-96yial/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
...........F..F
Failures:
1) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["", "one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-aocvzd/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["", "justonelongline", "here"]
(compared using ==)
# /tmp/d20141030-18133-aocvzd/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01603 seconds
15 examples, 2 failures
Failed examples:
rspec /tmp/d20141030-18133-aocvzd/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-aocvzd/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
...FFFFFFFF.F.F
Failures:
1) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap is not influenced by trailing whitespace
Failure/Error: expect("one more string \n ".word_wrap(7)).to eq ['one', 'more', 'string']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:35:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
TypeError:
no implicit conversion of Range into Integer
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `delete_at'
# /tmp/d20141030-18133-j8bdt3/solution.rb:11:in `word_wrap'
# /tmp/d20141030-18133-j8bdt3/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01355 seconds
15 examples, 10 failures
Failed examples:
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:34 # String#word_wrap is not influenced by trailing whitespace
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-j8bdt3/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
............... Finished in 0.01277 seconds 15 examples, 0 failures
............... Finished in 0.01268 seconds 15 examples, 0 failures
...FFFFFFFF.F.F
Failures:
1) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
expected: ["one word", "n two", "words"]
got: ["one word", " n two", " words"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
expected: ["one", "two"]
got: ["one", " two"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: ["point", " one two"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
expected: ["point line", "parallelogram", "cube"]
got: ["point line", " parallelogram", " cube"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one", " more", " string"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap is not influenced by trailing whitespace
Failure/Error: expect("one more string \n ".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one", " more", " string"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:35:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one", " more", " string"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: ["one more", " string"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за търпението", " и ура за живота!"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["justonelongline", " here"]
(compared using ==)
# /tmp/d20141030-18133-lbflim/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01774 seconds
15 examples, 10 failures
Failed examples:
rspec /tmp/d20141030-18133-lbflim/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-lbflim/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-lbflim/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-lbflim/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-lbflim/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-lbflim/spec.rb:34 # String#word_wrap is not influenced by trailing whitespace
rspec /tmp/d20141030-18133-lbflim/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-lbflim/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-lbflim/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-lbflim/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
............... Finished in 0.01314 seconds 15 examples, 0 failures
............... Finished in 0.0132 seconds 15 examples, 0 failures
...........F..F
Failures:
1) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["", "one"]
(compared using ==)
# /tmp/d20141030-18133-13ti53q/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["", "justonelongline"]
(compared using ==)
# /tmp/d20141030-18133-13ti53q/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01822 seconds
15 examples, 2 failures
Failed examples:
rspec /tmp/d20141030-18133-13ti53q/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-13ti53q/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
..........F.F..
Failures:
1) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: ["one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1k45v59/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за търпението", "и ура за", "живота!"]
(compared using ==)
# /tmp/d20141030-18133-1k45v59/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01711 seconds
15 examples, 2 failures
Failed examples:
rspec /tmp/d20141030-18133-1k45v59/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-1k45v59/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
...........FFFF
Failures:
1) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
Timeout::Error:
execution expired
# /tmp/d20141030-18133-b7jus5/solution.rb:20:in `get_result'
# /tmp/d20141030-18133-b7jus5/solution.rb:10:in `word_wrap'
# /tmp/d20141030-18133-b7jus5/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за търпението", "и ура живота!"]
(compared using ==)
# /tmp/d20141030-18133-b7jus5/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
Timeout::Error:
execution expired
# /tmp/d20141030-18133-b7jus5/solution.rb:20:in `get_result'
# /tmp/d20141030-18133-b7jus5/solution.rb:10:in `word_wrap'
# /tmp/d20141030-18133-b7jus5/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
Timeout::Error:
execution expired
# /tmp/d20141030-18133-b7jus5/solution.rb:21:in `block in get_result'
# /tmp/d20141030-18133-b7jus5/solution.rb:21:in `take_while'
# /tmp/d20141030-18133-b7jus5/solution.rb:21:in `get_result'
# /tmp/d20141030-18133-b7jus5/solution.rb:10:in `word_wrap'
# /tmp/d20141030-18133-b7jus5/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 3.31 seconds
15 examples, 4 failures
Failed examples:
rspec /tmp/d20141030-18133-b7jus5/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-b7jus5/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-b7jus5/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-b7jus5/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
..FFFFFF.FFF..F
Failures:
1) String#word_wrap can split words given exact length
Failure/Error: expect('one two'.word_wrap(3)).to eq ['one', 'two']
expected: ["one", "two"]
got: ["one"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:11:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
expected: ["one word", "n two", "words"]
got: ["one word", "n two"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
expected: ["one", "two"]
got: ["one"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: ["point", "one"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
expected: ["point line", "parallelogram", "cube"]
got: ["point line", "parallelogram"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one", "more"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one", "more"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: ["one more"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["ne", "re"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["gline"]
(compared using ==)
# /tmp/d20141030-18133-1bmyl89/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01523 seconds
15 examples, 10 failures
Failed examples:
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:10 # String#word_wrap can split words given exact length
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-1bmyl89/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
...........F..F
Failures:
1) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
Timeout::Error:
execution expired
# /tmp/d20141030-18133-1nd9gev/solution.rb:35:in `word_wrapper'
# /tmp/d20141030-18133-1nd9gev/solution.rb:14:in `word_wrap'
# /tmp/d20141030-18133-1nd9gev/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
Timeout::Error:
execution expired
# /tmp/d20141030-18133-1nd9gev/solution.rb:23:in `=='
# /tmp/d20141030-18133-1nd9gev/solution.rb:23:in `word_wrapper'
# /tmp/d20141030-18133-1nd9gev/solution.rb:14:in `word_wrap'
# /tmp/d20141030-18133-1nd9gev/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 2.22 seconds
15 examples, 2 failures
Failed examples:
rspec /tmp/d20141030-18133-1nd9gev/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-1nd9gev/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
.F...F.F...FFFF
Failures:
1) String#word_wrap reduces whitespace-only strings to an empty array
Failure/Error: expect(" \n ".word_wrap(3)).to eq []
expected: []
got: [""]
(compared using ==)
# /tmp/d20141030-18133-16yeg6o/spec.rb:7:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: ["point", "one", "two"]
(compared using ==)
# /tmp/d20141030-18133-16yeg6o/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["", "onemore", "string"]
(compared using ==)
# /tmp/d20141030-18133-16yeg6o/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["on", "e", "mo", "re", "st", "ri", "ng"]
(compared using ==)
# /tmp/d20141030-18133-16yeg6o/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за търпението", "иура за живота!"]
(compared using ==)
# /tmp/d20141030-18133-16yeg6o/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: ["まつもとさんは", "Rubyのおとうさん", "."]
(compared using ==)
# /tmp/d20141030-18133-16yeg6o/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["justo", "nelon", "gline", "here"]
(compared using ==)
# /tmp/d20141030-18133-16yeg6o/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01795 seconds
15 examples, 7 failures
Failed examples:
rspec /tmp/d20141030-18133-16yeg6o/spec.rb:6 # String#word_wrap reduces whitespace-only strings to an empty array
rspec /tmp/d20141030-18133-16yeg6o/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-16yeg6o/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-16yeg6o/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-16yeg6o/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-16yeg6o/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-16yeg6o/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
.........FFFFFF
Failures:
1) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["one ", "more ", "string"]
(compared using ==)
# /tmp/d20141030-18133-w8ksi2/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: ["one more ", "string"]
(compared using ==)
# /tmp/d20141030-18133-w8ksi2/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["on", "e", "mo", "re", "st", "ri", "ng"]
(compared using ==)
# /tmp/d20141030-18133-w8ksi2/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси за", "търпението и", "ура за живота!"]
(compared using ==)
# /tmp/d20141030-18133-w8ksi2/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: ["まつもとさんは", "Rubyのおとうさん", "."]
(compared using ==)
# /tmp/d20141030-18133-w8ksi2/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["justo", "nelon", "gline", "here"]
(compared using ==)
# /tmp/d20141030-18133-w8ksi2/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.0155 seconds
15 examples, 6 failures
Failed examples:
rspec /tmp/d20141030-18133-w8ksi2/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-w8ksi2/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-w8ksi2/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-w8ksi2/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-w8ksi2/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-w8ksi2/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
............... Finished in 0.01441 seconds 15 examples, 0 failures
............... Finished in 0.01216 seconds 15 examples, 0 failures
............... Finished in 0.01832 seconds 15 examples, 0 failures
............... Finished in 0.01748 seconds 15 examples, 0 failures
............... Finished in 0.03359 seconds 15 examples, 0 failures
............... Finished in 0.01447 seconds 15 examples, 0 failures
............... Finished in 0.01329 seconds 15 examples, 0 failures
FFFFFFFFFFFFFFF
Failures:
1) String#word_wrap reduces the empty string to an empty array
Failure/Error: expect(''.word_wrap(2)).to eq []
expected: []
got: ""
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:3:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap reduces whitespace-only strings to an empty array
Failure/Error: expect(" \n ".word_wrap(3)).to eq []
expected: []
got: ""
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:7:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap can split words given exact length
Failure/Error: expect('one two'.word_wrap(3)).to eq ['one', 'two']
expected: ["one", "two"]
got: "one two"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:11:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
expected: ["one word", "n two", "words"]
got: "one word n two words"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
expected: ["one", "two"]
got: "one two"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: "point one two"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
expected: ["point line", "parallelogram", "cube"]
got: "point line parallelogram cube"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: "one more string"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) String#word_wrap is not influenced by trailing whitespace
Failure/Error: expect("one more string \n ".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: "one more string"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:35:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: "one more string"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
11) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: "one more string"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
12) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: "one more string"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
13) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: "Мерси за търпението и ура за живота!"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
14) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: "まつもとさんは Rubyのおとうさん."
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
15) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: "justonelongline here"
(compared using ==)
# /tmp/d20141030-18133-iyjmnj/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01383 seconds
15 examples, 15 failures
Failed examples:
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:2 # String#word_wrap reduces the empty string to an empty array
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:6 # String#word_wrap reduces whitespace-only strings to an empty array
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:10 # String#word_wrap can split words given exact length
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:34 # String#word_wrap is not influenced by trailing whitespace
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-iyjmnj/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
............... Finished in 0.0122 seconds 15 examples, 0 failures
............... Finished in 0.01529 seconds 15 examples, 0 failures
...........F.FF
Failures:
1) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["ne", "re", "ng"]
(compared using ==)
# /tmp/d20141030-18133-9f99fx/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: ["まつもとさんは", "ubyのおとうさん."]
(compared using ==)
# /tmp/d20141030-18133-9f99fx/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["gline", "here"]
(compared using ==)
# /tmp/d20141030-18133-9f99fx/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01541 seconds
15 examples, 3 failures
Failed examples:
rspec /tmp/d20141030-18133-9f99fx/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-9f99fx/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-9f99fx/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
...F.FF...F.F..
Failures:
1) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
expected: ["one word", "n two", "words"]
got: ["one", "word", "n", "two", "words"]
(compared using ==)
# /tmp/d20141030-18133-3kbx0u/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: ["point", "one", "two"]
(compared using ==)
# /tmp/d20141030-18133-3kbx0u/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
expected: ["point line", "parallelogram", "cube"]
got: ["point", "line", "parallelogram", "cube"]
(compared using ==)
# /tmp/d20141030-18133-3kbx0u/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: ["one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-3kbx0u/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: ["Мерси", "за", "търпението", "и", "ура", "за", "живота!"]
(compared using ==)
# /tmp/d20141030-18133-3kbx0u/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01338 seconds
15 examples, 5 failures
Failed examples:
rspec /tmp/d20141030-18133-3kbx0u/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-3kbx0u/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-3kbx0u/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-3kbx0u/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-3kbx0u/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
..F........F..F
Failures:
1) String#word_wrap can split words given exact length
Failure/Error: expect('one two'.word_wrap(3)).to eq ['one', 'two']
expected: ["one", "two"]
got: [" one", "two"]
(compared using ==)
# /tmp/d20141030-18133-1q51rol/spec.rb:11:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["", "one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1q51rol/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["", "justonelongline", "here"]
(compared using ==)
# /tmp/d20141030-18133-1q51rol/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01604 seconds
15 examples, 3 failures
Failed examples:
rspec /tmp/d20141030-18133-1q51rol/spec.rb:10 # String#word_wrap can split words given exact length
rspec /tmp/d20141030-18133-1q51rol/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-1q51rol/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
..FFFFFFFFFFFFF
Failures:
1) String#word_wrap can split words given exact length
Failure/Error: expect('one two'.word_wrap(3)).to eq ['one', 'two']
expected: ["one", "two"]
got: ["", "one", "two"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:11:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
expected: ["one word", "n two", "words"]
got: [" one word", "n two", "words"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
expected: ["one", "two"]
got: [" one", "two"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
expected: ["point", "one two"]
got: [" point", "one two"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
expected: ["point line", "parallelogram", "cube"]
got: [" point line", "parallelogram", "cube"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap is not influenced by leading whitespace
Failure/Error: expect(" \n one\nmore string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: [" one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:31:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap is not influenced by trailing whitespace
Failure/Error: expect("one more string \n ".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: [" one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:35:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: [" one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
expected: ["one more", "string"]
got: [" one more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
expected: ["one", "more", "string"]
got: ["", "one", "more", "string"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
11) String#word_wrap splits text with cyrillic correctly
Failure/Error: expect(" Мерси за търпението и\nура за живота! ".word_wrap(20)).to eq ['Мерси за търпението', 'и ура за живота!']
expected: ["Мерси за търпението", "и ура за живота!"]
got: [" Мерси за търпението", "и ура за живота!"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:51:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
12) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
expected: ["まつもとさんは", "Rubyのおとうさん."]
got: [" まつもとさんは", "Rubyのおとうさん."]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
13) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
expected: ["justonelongline", "here"]
got: ["", "justonelongline", "here"]
(compared using ==)
# /tmp/d20141030-18133-1bmjijc/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.01515 seconds
15 examples, 13 failures
Failed examples:
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:10 # String#word_wrap can split words given exact length
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:30 # String#word_wrap is not influenced by leading whitespace
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:34 # String#word_wrap is not influenced by trailing whitespace
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:50 # String#word_wrap splits text with cyrillic correctly
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-1bmjijc/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line
..FFFFF..FFF.FF
Failures:
1) String#word_wrap can split words given exact length
Failure/Error: expect('one two'.word_wrap(3)).to eq ['one', 'two']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:11:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) String#word_wrap correctly counts the whitespace between words
Failure/Error: expect('one word n two words'.word_wrap(9)).to eq ['one word', 'n two', 'words']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:15:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) String#word_wrap can split words given more length
Failure/Error: expect('one two'.word_wrap(6)).to eq ['one', 'two']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:19:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) String#word_wrap splits on the nearest left whitespace
Failure/Error: expect('point one two'.word_wrap(8)).to eq ['point', 'one two']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:23:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) String#word_wrap can split more than once
Failure/Error: expect('point line parallelogram cube'.word_wrap(15)).to eq ['point line', 'parallelogram', 'cube']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:27:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) String#word_wrap ignores more than one whitespace between lines
Failure/Error: expect("one more \n string".word_wrap(7)).to eq ['one', 'more', 'string']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:39:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) String#word_wrap compacts whitespace inside lines
Failure/Error: expect("one more string".word_wrap(12)).to eq ['one more', 'string']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:43:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) String#word_wrap keeps longer lines if it is a single word
Failure/Error: expect("one more string".word_wrap(2)).to eq ['one', 'more', 'string']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:47:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) String#word_wrap splits text with hiragana letters correctly
Failure/Error: expect("まつもとさんは Rubyのおとうさん. ".word_wrap(10)).to eq ['まつもとさんは', 'Rubyのおとうさん.']
Timeout::Error:
execution expired
# /tmp/d20141030-18133-11hc6ap/solution.rb:10:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:55:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) String#word_wrap allows lines longer than max line length if there is nowhere to break the line
Failure/Error: expect('justonelongline here'.word_wrap(5)).to eq ['justonelongline', 'here']
NoMethodError:
undefined method `squeeze!' for nil:NilClass
# /tmp/d20141030-18133-11hc6ap/solution.rb:5:in `word_wrap'
# /tmp/d20141030-18133-11hc6ap/spec.rb:59:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 1.11 seconds
15 examples, 10 failures
Failed examples:
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:10 # String#word_wrap can split words given exact length
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:14 # String#word_wrap correctly counts the whitespace between words
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:18 # String#word_wrap can split words given more length
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:22 # String#word_wrap splits on the nearest left whitespace
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:26 # String#word_wrap can split more than once
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:38 # String#word_wrap ignores more than one whitespace between lines
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:42 # String#word_wrap compacts whitespace inside lines
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:46 # String#word_wrap keeps longer lines if it is a single word
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:54 # String#word_wrap splits text with hiragana letters correctly
rspec /tmp/d20141030-18133-11hc6ap/spec.rb:58 # String#word_wrap allows lines longer than max line length if there is nowhere to break the line