= spec_converter

== DESCRIPTION
Simple converter to go from test-unit or dust style tests to test-spec (http://rubyforge.org/projects/test-spec) specs.

== FEATURES/PROBLEMS
This will change all files in place!! Make sure you are properly backed up and/or committed to SVN before running.

== INSTALL
sudo gem install spec-converter

== USAGE
Assuming your project is at ~/work/project/:

cd ~/work/project
spec_converter

== URLS:
* test/spec: http://rubyforge.org/projects/test-spec
* trac: http://opensource.thinkrelevance.com/wiki/spec-converter
* svn trunk: https://opensource.thinkrelevance.com/svn/spec_converter/trunk
* rdoc: http://spec-converter.rubyforge.org/rdoc

= Spec report

== converting from test/spec old style to new style names
* replaces spec context with describe
* ignores unrelated uses of 'context'
* replaces spec specify with it
* ignores unrelated uses of 'specify'

== converting dust style to test/spec style
* changes test...do to it...do
* ignores unrelated lines

== converting ActionController::IntegrationTest style to describe blocks
* replaces class FooTest < ActionController::IntegrationTest with describe foo do

== converting Test::Unit style to describe blocks
* replaces class FooTest < Test::Unit::TestCase with describe foo do
* replaces class FooTest < Test::Unit::TestCase with silly whitespacing with describe foo do
* converts namespaced test unit classes
* ignores unrelated classes

== converting Test::Unit methods to it blocks
* replaces def setup with before do
* ignores method definitions that only start with setup
* replaces class def test_something? with it something? do
* replaces class def test_something? with it something? do
* replaces class def test_something with it something do
* replaces class def test_something with it something do when it has leading whitespace
* ignores unrelated lines
* ignores unrelated lines with leading whitespace

== converting assertions
* replaces assert !foo to foo.should == false
* replaces assert_equal y, x, bar to x.should == y
* replaces assert foo to foo.should == true
* replaces assert_nil foo to foo.should == nil
* replaces assert_true foo to foo.should == true
* replaces assert_false foo to foo.should == false
* replaces assert_not_nil foo to foo.should.not == nil
* replaces assert foo > 20 to foo.should > 20

= LICENSE:

(The MIT License)

Copyright (c) 2007-08 Relevance

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.