On Thursday 02 November 2006 13:10, Skotty wrote:
> I know guys, I'm sorry.
> Anyways, I was wondering. I've been following a guide on
> http://clarkware.com/cgi/blosxom/2005/04/index.html
>
> and on the first example for the tutorial he posts 2 test to do, at the end
> of the first test there are 2 "ends" followed by the next test.
>
> Now this is probably something I could have easily answered myself but
> where do I put the second test? before the 2 ends?
>
> Here's a sample of what I have.
>
> require 'test/unit'
>
> class StringTest < Test::Unit::TestCase
>
> def test_length
> s = "Hello, World!"
> assert_equal(13, s.length)
> end
>
> end
>
> def test_expression_substitution
> assert_equal("", "#{'Hello! ' * 3}")
> end
>
> when you run the script, it's suppose to tell you how many tests are run,
> and if any of them are wrong synatx. When I run it this way, it only shows
> one test and no error message. Am I doing something wrong?
>
> Anyways a little help please!

require 'test/unit'

class StringTest < Test::Unit::TestCase
  def test_length
    s = "Hello, World!"
    assert_equal(13, s.length)
  end

  def test_expression_substitution
    assert_equal("", "#{'Hello! ' * 3}")
  end
end