[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Ruby noobist, roobist?

Michael Fellinger

11/2/2006 7:11:00 AM

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/...
>
> 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

12 Answers

Skotty

11/2/2006 7:21:00 AM

0

Sweet thanks for the quick response!
----- Original Message -----
From: "Michael Fellinger" <m.fellinger@gmail.com>
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Wednesday, November 01, 2006 11:11 PM
Subject: Re: Ruby noobist, roobist?


> 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/...
>>
>> 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
>


Nicky

11/1/2011 10:16:00 AM

0

On Nov 1, 7:40 am, Bill Swears <wswe...@gci.net> wrote:
> On 10/31/2011 12:14 PM, Nicky wrote:
>
>
>
>
>
>
>
> > On Oct 30, 5:47 pm, Suzanne Blom<bo...@sueblom.net>  wrote:
> >> Sorry, but I'm too rushed to look up the November thing.  But I did
> >> it--I wrote 50,000 words on a book that is now being revised and is up
> >> to 58,000 words.  But I did it midSeptember to midOctober.
>
> >> I thought I knew what wanting to write a book was like.  I thought my
> >> fantasy of walking out of the city to hide would go away once tax season
> >> was over.  I thought I revising this other novel would take all my
> >> attention for the year.  Ha, ha, and ha again.
>
> >> Now that the rough draft is over, I am taking the time to buy food and
> >> like that again.  But IT is still taking most of my time.
>
> >> My biggest disappointment at the moment is that I haven't gotten into
> >> the cop side of the cop shop downtown.  I know I could scoot around the
> >> barricades....
>
> >> I'm possessed, I tell you, possessed.  Does _The Bloody Rose_ do for a
> >> title?
>
> > Know the feeling. It's great. I have just sold the last book I wrote
> > like that - back in 2009.
> > Enjoy it those times are rare.Like the title.
>
> Woohoo!   You were pretty down on yourself when that one didn't sell
> initially, IIRC.
>
> Bill


Yeah it took time and I am rewriting it. It also won't be published
under my usual name but I'm glad to have found it a home. It consumed
me while I wrote it, like Suzanne's seems to be doing and I was really
pleased with it.

Nicky

Suzanne Blom

11/1/2011 9:38:00 PM

0

On 11/1/2011 5:16 AM, Nicky wrote:
> On Nov 1, 7:40 am, Bill Swears<wswe...@gci.net> wrote:
>> On 10/31/2011 12:14 PM, Nicky wrote:
>>
>>
>>
>>
>>
>>
>>
>>> On Oct 30, 5:47 pm, Suzanne Blom<bo...@sueblom.net> wrote:
>>>> Sorry, but I'm too rushed to look up the November thing. But I did
>>>> it--I wrote 50,000 words on a book that is now being revised and is up
>>>> to 58,000 words. But I did it midSeptember to midOctober.
>>
>>>> I thought I knew what wanting to write a book was like. I thought my
>>>> fantasy of walking out of the city to hide would go away once tax season
>>>> was over. I thought I revising this other novel would take all my
>>>> attention for the year. Ha, ha, and ha again.
>>
>>>> Now that the rough draft is over, I am taking the time to buy food and
>>>> like that again. But IT is still taking most of my time.
>>
>>>> My biggest disappointment at the moment is that I haven't gotten into
>>>> the cop side of the cop shop downtown. I know I could scoot around the
>>>> barricades....
>>
>>>> I'm possessed, I tell you, possessed. Does _The Bloody Rose_ do for a
>>>> title?
>>
>>> Know the feeling. It's great. I have just sold the last book I wrote
>>> like that - back in 2009.

Good news.

>>> Enjoy it those times are rare.Like the title.
>>
I like the title as well, but I honestly don't think it fits the book.
Am trying to think of other "bloody" good titles that are less, um,
romantic, maybe?

> Yeah it took time and I am rewriting it. It also won't be published
> under my usual name but I'm glad to have found it a home. It consumed
> me while I wrote it, like Suzanne's seems to be doing and I was really
> pleased with it.
>
Now that it's in revision, it's not so all-consuming. I get to buy
groceries!
& go out to lunch!

Nicky

11/2/2011 9:49:00 AM

0

On Nov 1, 9:38 pm, Suzanne Blom <bo...@sueblom.net> wrote:
> On 11/1/2011 5:16 AM, Nicky wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 1, 7:40 am, Bill Swears<wswe...@gci.net>  wrote:
> >> On 10/31/2011 12:14 PM, Nicky wrote:
>
> >>> On Oct 30, 5:47 pm, Suzanne Blom<bo...@sueblom.net>    wrote:
> >>>> Sorry, but I'm too rushed to look up the November thing.  But I did
> >>>> it--I wrote 50,000 words on a book that is now being revised and is up
> >>>> to 58,000 words.  But I did it midSeptember to midOctober.
>
> >>>> I thought I knew what wanting to write a book was like.  I thought my
> >>>> fantasy of walking out of the city to hide would go away once tax season
> >>>> was over.  I thought I revising this other novel would take all my
> >>>> attention for the year.  Ha, ha, and ha again.
>
> >>>> Now that the rough draft is over, I am taking the time to buy food and
> >>>> like that again.  But IT is still taking most of my time.
>
> >>>> My biggest disappointment at the moment is that I haven't gotten into
> >>>> the cop side of the cop shop downtown.  I know I could scoot around the
> >>>> barricades....
>
> >>>> I'm possessed, I tell you, possessed.  Does _The Bloody Rose_ do for a
> >>>> title?
>
> >>> Know the feeling. It's great. I have just sold the last book I wrote
> >>> like that - back in 2009.
>
> Good news.
>
> >>> Enjoy it those times are rare.Like the title.
>
> I like the title as well, but I honestly don't think it fits the book.
> Am trying to think of other "bloody" good titles that are less, um,
> romantic, maybe?
>
> > Yeah it took time and I am rewriting it. It also won't be published
> > under my usual name but I'm glad to have found it a home. It consumed
> > me while I wrote it, like Suzanne's seems to be doing and I was really
> > pleased with it.
>
> Now that it's in revision, it's not so all-consuming.  I get to buy
> groceries!
> & go out to lunch!

Not sure I did much revision on the original but I'm paying for that
now.
You'll have to write another book to fit the good title.
I've just sent two sheets of possible titles to the publisher - can't
say I like any of them as much as my original defunct title : (

Good luck with the book,
Nicky

Suzanne Blom

11/2/2011 9:41:00 PM

0

On 11/2/2011 4:48 AM, Nicky wrote:
> On Nov 1, 9:38 pm, Suzanne Blom<bo...@sueblom.net> wrote:
>> On 11/1/2011 5:16 AM, Nicky wrote:
>>
>>> On Nov 1, 7:40 am, Bill Swears<wswe...@gci.net> wrote:
>>>> On 10/31/2011 12:14 PM, Nicky wrote:
>>
>>>>> Know the feeling. It's great. I have just sold the last book I wrote
>>>>> like that - back in 2009.
>>
>> Good news.
>>
>>>>> Enjoy it those times are rare.Like the title.
>>
>> I like the title as well, but I honestly don't think it fits the book.
>> Am trying to think of other "bloody" good titles that are less, um,
>> romantic, maybe?
>>
>>> Yeah it took time and I am rewriting it. It also won't be published
>>> under my usual name but I'm glad to have found it a home. It consumed
>>> me while I wrote it, like Suzanne's seems to be doing and I was really
>>> pleased with it.
>>
>> Now that it's in revision, it's not so all-consuming. I get to buy
>> groceries!
>> & go out to lunch!
>
> Not sure I did much revision on the original but I'm paying for that
> now.
> You'll have to write another book to fit the good title.
> I've just sent two sheets of possible titles to the publisher - can't
> say I like any of them as much as my original defunct title : (
>
What was the problem with the defunct title again?

Nicky

11/2/2011 9:51:00 PM

0

On Nov 2, 9:40 pm, Suzanne Blom <bo...@sueblom.net> wrote:
> On 11/2/2011 4:48 AM, Nicky wrote:
>
>
>
>
>
>
>
> > On Nov 1, 9:38 pm, Suzanne Blom<bo...@sueblom.net>  wrote:
> >> On 11/1/2011 5:16 AM, Nicky wrote:
>
> >>> On Nov 1, 7:40 am, Bill Swears<wswe...@gci.net>    wrote:
> >>>> On 10/31/2011 12:14 PM, Nicky wrote:
>
> >>>>> Know the feeling. It's great. I have just sold the last book I wrote
> >>>>> like that - back in 2009.
>
> >> Good news.
>
> >>>>> Enjoy it those times are rare.Like the title.
>
> >> I like the title as well, but I honestly don't think it fits the book.
> >> Am trying to think of other "bloody" good titles that are less, um,
> >> romantic, maybe?
>
> >>> Yeah it took time and I am rewriting it. It also won't be published
> >>> under my usual name but I'm glad to have found it a home. It consumed
> >>> me while I wrote it, like Suzanne's seems to be doing and I was really
> >>> pleased with it.
>
> >> Now that it's in revision, it's not so all-consuming.  I get to buy
> >> groceries!
> >> &  go out to lunch!
>
> > Not sure I did much revision on the original but I'm paying for that
> > now.
> > You'll have to write another book to fit the good title.
> > I've just sent two sheets of possible titles to the publisher - can't
> > say I like any of them as much as my original defunct title : (
>
> What was the problem with the defunct title again?

Oh well the original title was 'The Mulholland Changeling' but the
publisher wants to lose all faery refs because they might suggest the
book is fey and really it's more horror : )
It's fair point and I don't mind changing it, I just can't come up
with a title that I like.

Suzanne Blom

11/3/2011 3:32:00 PM

0

On 11/2/2011 4:50 PM, Nicky wrote:
> On Nov 2, 9:40 pm, Suzanne Blom<bo...@sueblom.net> wrote:
>> On 11/2/2011 4:48 AM, Nicky wrote:
>>
>>
>>
>>
>>
>>
>>
>>> On Nov 1, 9:38 pm, Suzanne Blom<bo...@sueblom.net> wrote:
>>>> On 11/1/2011 5:16 AM, Nicky wrote:
>>
>>>>> On Nov 1, 7:40 am, Bill Swears<wswe...@gci.net> wrote:
>>>>>> On 10/31/2011 12:14 PM, Nicky wrote:
>>
>>>>>>> Know the feeling. It's great. I have just sold the last book I wrote
>>>>>>> like that - back in 2009.
>>
>>>> Good news.
>>
>>>>>>> Enjoy it those times are rare.Like the title.
>>
>>>> I like the title as well, but I honestly don't think it fits the book.
>>>> Am trying to think of other "bloody" good titles that are less, um,
>>>> romantic, maybe?
>>
>>>>> Yeah it took time and I am rewriting it. It also won't be published
>>>>> under my usual name but I'm glad to have found it a home. It consumed
>>>>> me while I wrote it, like Suzanne's seems to be doing and I was really
>>>>> pleased with it.
>>
>>>> Now that it's in revision, it's not so all-consuming. I get to buy
>>>> groceries!
>>>> & go out to lunch!
>>
>>> Not sure I did much revision on the original but I'm paying for that
>>> now.
>>> You'll have to write another book to fit the good title.
>>> I've just sent two sheets of possible titles to the publisher - can't
>>> say I like any of them as much as my original defunct title : (
>>
>> What was the problem with the defunct title again?
>
> Oh well the original title was 'The Mulholland Changeling' but the
> publisher wants to lose all faery refs because they might suggest the
> book is fey and really it's more horror : )
> It's fair point and I don't mind changing it, I just can't come up
> with a title that I like.

Except I'm pretty sure I've seen "changeling" as a horror-type thing.
It can be a pretty horrific concept. OTOH if the publisher thinks fay
references will make fewer people buy the book, that may be a valid point.

Suzanne Blom

11/4/2011 10:55:00 PM

0

On 11/3/2011 1:22 PM, John W Kennedy wrote:
> On 2011-11-03 15:32:11 +0000, Suzanne Blom said:
>
>> On 11/2/2011 4:50 PM, Nicky wrote:
>>> On Nov 2, 9:40 pm, Suzanne Blom<bo...@sueblom.net> wrote:
>>>> On 11/2/2011 4:48 AM, Nicky wrote:
>>>>
>>>>> On Nov 1, 9:38 pm, Suzanne Blom<bo...@sueblom.net> wrote:
>>>>>> On 11/1/2011 5:16 AM, Nicky wrote:
>>>>
>>>>>> I like the title as well, but I honestly don't think it fits the
>>>>>> book.
>>>>>> Am trying to think of other "bloody" good titles that are less, um,
>>>>>> romantic, maybe?
>>>>
>>>>>>> Yeah it took time and I am rewriting it. It also won't be published
>>>>>>> under my usual name but I'm glad to have found it a home. It
>>>>>>> consumed
>>>>>>> me while I wrote it, like Suzanne's seems to be doing and I was
>>>>>>> really
>>>>>>> pleased with it.
>>>>
>>>>>> Now that it's in revision, it's not so all-consuming. I get to buy
>>>>>> groceries! & go out to lunch!
>>>>
>>>>> Not sure I did much revision on the original but I'm paying for that
>>>>> now.
>>>>> You'll have to write another book to fit the good title.
>>>>> I've just sent two sheets of possible titles to the publisher - can't
>>>>> say I like any of them as much as my original defunct title : (
>>>>
>>>> What was the problem with the defunct title again?
>>>
>>> Oh well the original title was 'The Mulholland Changeling' but the
>>> publisher wants to lose all faery refs because they might suggest the
>>> book is fey and really it's more horror : )
>>> It's fair point and I don't mind changing it, I just can't come up
>>> with a title that I like.
>>
>> Except I'm pretty sure I've seen "changeling" as a horror-type thing.
>> It can be a pretty horrific concept. OTOH if the publisher thinks fay
>> references will make fewer people buy the book, that may be a valid
>> point.
>
> I'd be more concerned that it might be confused with the recent movie
> about the Christine Collins case.
>
Aha, that's media and I didn't know about it. okay.

Geoffrey Garrett

11/5/2011 6:56:00 AM

0

In article <j91qf6$e95$1@dont-email.me>, Suzanne Blom
<books@sueblom.net> wrote:

> On 11/3/2011 1:22 PM, John W Kennedy wrote:
> > On 2011-11-03 15:32:11 +0000, Suzanne Blom said:
> >
> >> On 11/2/2011 4:50 PM, Nicky wrote:
> >>> On Nov 2, 9:40 pm, Suzanne Blom<bo...@sueblom.net> wrote:
> >>>> On 11/2/2011 4:48 AM, Nicky wrote:
> >>>>
> >>>>> On Nov 1, 9:38 pm, Suzanne Blom<bo...@sueblom.net> wrote:
> >>>>>> On 11/1/2011 5:16 AM, Nicky wrote:
> >>>>
> >>>>>> I like the title as well, but I honestly don't think it fits the
> >>>>>> book.
> >>>>>> Am trying to think of other "bloody" good titles that are less, um,
> >>>>>> romantic, maybe?
> >>>>
> >>>>>>> Yeah it took time and I am rewriting it. It also won't be published
> >>>>>>> under my usual name but I'm glad to have found it a home. It
> >>>>>>> consumed
> >>>>>>> me while I wrote it, like Suzanne's seems to be doing and I was
> >>>>>>> really
> >>>>>>> pleased with it.
> >>>>
> >>>>>> Now that it's in revision, it's not so all-consuming. I get to buy
> >>>>>> groceries! & go out to lunch!
> >>>>
> >>>>> Not sure I did much revision on the original but I'm paying for that
> >>>>> now.
> >>>>> You'll have to write another book to fit the good title.
> >>>>> I've just sent two sheets of possible titles to the publisher - can't
> >>>>> say I like any of them as much as my original defunct title : (
> >>>>
> >>>> What was the problem with the defunct title again?
> >>>
> >>> Oh well the original title was 'The Mulholland Changeling' but the
> >>> publisher wants to lose all faery refs because they might suggest the
> >>> book is fey and really it's more horror : )
> >>> It's fair point and I don't mind changing it, I just can't come up
> >>> with a title that I like.
> >>
> >> Except I'm pretty sure I've seen "changeling" as a horror-type thing.
> >> It can be a pretty horrific concept. OTOH if the publisher thinks fay
> >> references will make fewer people buy the book, that may be a valid
> >> point.
> >
> > I'd be more concerned that it might be confused with the recent movie
> > about the Christine Collins case.
> >
> Aha, that's media and I didn't know about it. okay.

Yes, Changeling is the title of a horror piece... a ghost movie from
1980 with George C. Scott.

http://www.imdb.com/title/...

Suzanne Blom

11/5/2011 9:40:00 PM

0

On 11/5/2011 1:56 AM, Geoffrey Garrett wrote:
> In article<j91qf6$e95$1@dont-email.me>, Suzanne Blom
> <books@sueblom.net> wrote:
>
>> On 11/3/2011 1:22 PM, John W Kennedy wrote:
>>> On 2011-11-03 15:32:11 +0000, Suzanne Blom said:
>>>
>>>> On 11/2/2011 4:50 PM, Nicky wrote:
>>>>> On Nov 2, 9:40 pm, Suzanne Blom<bo...@sueblom.net> wrote:
>>>>>>
>>>>>> What was the problem with the defunct title again?
>>>>>
>>>>> Oh well the original title was 'The Mulholland Changeling' but the
>>>>> publisher wants to lose all faery refs because they might suggest the
>>>>> book is fey and really it's more horror : )
>>>>> It's fair point and I don't mind changing it, I just can't come up
>>>>> with a title that I like.
>>>>
>>>> Except I'm pretty sure I've seen "changeling" as a horror-type thing.
>>>> It can be a pretty horrific concept. OTOH if the publisher thinks fay
>>>> references will make fewer people buy the book, that may be a valid
>>>> point.
>>>
>>> I'd be more concerned that it might be confused with the recent movie
>>> about the Christine Collins case.
>>>
>> Aha, that's media and I didn't know about it. okay.
>
> Yes, Changeling is the title of a horror piece... a ghost movie from
> 1980 with George C. Scott.
>
> http://www.imdb.com/title/...

OTOH, I don't really think 1980 is recent.