Goal::Tdd

A small DSL that converts free text into pending tests/specs.

Installation

Add this line to your application's Gemfile:

gem 'todo_next'

And then execute:

$ bundle

Usage

Create a first spec with a todo_next skeleton:

$ cd <project>
$ todo_next stack
    # => <project>/spec/stack_spec.rb was created.
$ cat spec/stack_spec.rb
    # =>
    require 'rubygems'
    require 'rspec'
    require 'todo_next'

    todo_next("        A Foobar\n          \u221A is white by default\n            ex: puts Foobar.new.colour  # => 'white'\n          * can be resized\n            example:\n              foobar.resize!(+10, -2)\n          - can be reset\n          truthiness()\n            is always true\n            is never false\n          (add more tests)\n    TEXT\n\n        # \u221A == passed   => same as a comment line\n        # * == current  => leading char - '*' - is kept\n    # example blocks (ex:, example:) are ignored, like comments.\n\n    #describe \"<what you're testing>\" do\n    #  specify 'this should happen' do\n    #    .. some code\n    #  end\n")

This text is equivalent to :

        describe "A Foobar" do
          it '* can be resized'
          it 'can be reset'
          describe 'truthiness()' do
            it 'is always true'
            it 'is never false'
          end
          it '(add more tests)'
        end

screenshot1 screenshot1

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Code Climate