abraao / KataWordWrap

Word

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Word wrap coding kata

Problem statement

From http://www.codingdojo.org/cgi-bin/index.pl?KataWordWrap

You write a class called Wrapper, that has a single static function named wrap that takes two arguments, a string, and a column number. The function returns the string, but with line breaks inserted at just the right places to make sure that no line is longer than the column number. You try to break lines at word boundaries.

Like a word processor, break the line by replacing the last space in a line with a newline.

Implemented during a BCN Software Craftsmanship Coding Dojo.

How to

  1. Navigate to the project directory.
  2. Install the dependencies with bundle install
  3. Run the tests with bundle exec cucumber

Status

This is the code as it was at the end of the coding dojo. Don't take it as an indication of our best work :)

In particular:

  • The last test is currently failing.
  • There are no comments.

Resources

Contact

About

Word

License:MIT License


Languages

Language:Ruby 65.7%Language:Gherkin 34.3%