[rspec-devel] [ rspec-Feature Requests-14174 ] Seamless transition from Test::Unit

noreply at rubyforge.org noreply at rubyforge.org
Tue Sep 25 08:34:12 EDT 2007


Feature Requests item #14174, was opened at 2007-09-24 02:00
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=14174&group_id=797

Category: runner module
Group: None
Status: Closed
Priority: 3
Submitted By: Brian Takita (btakita)
Assigned to: Nobody (None)
Summary: Seamless transition from Test::Unit

Initial Comment:
test_ methods with an arity of 0 defined in a describe block or Example object will be run as an Example, providing a seamless transition from Test::Unit

This was checked in Rev 2564.

Lets say somebody wants to try rspec. Now they can with minimal fuss.

class FooTest < Test::Unit::TestCase
  def test_something
    assert true
  end
end

to:
# This now creates an Example
class FooSpec < Spec::DSL::Example
  def test_something
    assert true
  end
end

to:
class FooSpec < Spec::DSL::Example
  it "should assert something" do
    true.should be_true
  end
end

to:
describe Foo do
  it "should assert something" do
    true.should be_true
  end
end

----------------------------------------------------------------------

>Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-09-25 08:34

Message:
I don't see the value in introducing a step that only changes the superclass. Wouldn't this be better?

1)
class FooTest < Test::Unit::TestCase
  def test_something
    assert true
  end
end

2a)
class FooTest < Test::Unit::TestCase
  it "should assert something" do
    assert true
  end
end

2b)
describe Foo do
  def test_something
    assert true
  end
end

3)
describe Foo do
  it "should assert something" do
    assert true
  end
end

4)
describe Foo do
  it "should assert something" do
    true.should be_true
  end
end

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=14174&group_id=797


More information about the rspec-devel mailing list