[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Test::Unit - same test, different "args"

Michael Malone

3/23/2009 9:25:00 PM

Luke St.Clair wrote:
> I need to run the same unit test case more than 10 times (around 150
> tests in the test case), with 2-3 parameters changed each time.
>
> For instance, if I had unit tests to examine a "Person", with a
> required parameter "name" - let's say I want to run the same
> Test::Unit::TestCase on 10 different people, with different names but
> everything else the same. All test cases run the same code, just with
> the one (or two) parameters tweaked.
>
> Let's say I have 150 tests for a Person - I'd rather not end up with
> 1500 tests, each of the 150 tests exactly duplicated for a different
> "name".
>
> I'll have a hierarchy of tests cases, in suites, which may help
>
> Is there some way to:
> 1) set a global variable in the "parent" test suite that the children
> see? Seems like the answer to this is no
> 2) Pass an arg to the test case as a whole? Don't see anyway to do
> this in the docs
> 3) Do something else that will keep this test code compliant with DRY?
>
> What's the right approach here?
>
>
my first thought is to have your test_something methods call protected
methods of the class (that you create). Just because it's a unit test
doesn't mean it's not also a perfectly normal object - I often forget
that one. Using this in conjunction with a setup method and you should
be able to get things going as you want. IMHO hardwiring test data into
your test classes isn't a Bad Thing. It helps you keep your data/data
structures smart and your code dumb, so you can simply have an array or
something similar of the parameters you want, and then cycle through
those.

HTH,
Michael

=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================


30 Answers

\"jordy\

1/4/2014 3:01:00 PM

0


"We were talking about the space between us all and the people who hide themselves behind a wall"- those line from "within you without you" loosely describe the first side of the album... It's a crucial song on Sgt. Pepper...

The Bloomfield Bloviator

1/4/2014 4:13:00 PM

0

On Saturday, January 4, 2014 10:01:22 AM UTC-5, Jordy Chase wrote:

> "We were talking about the space between us all and the people who hide themselves behind a wall"- those line from "within you without you" loosely describe the first side of the album... It's a crucial song on Sgt. Pepper....

Not many people agree with you, but here's some other fun facts about the album.

None of the other three guys appear at all on "Within You, Without You," it's just George and 3 or 4 local Indian musicians who he hired.

"She's Leaving Home" is one of only 2 or 3 Beatles songs where none of the 4 members of the band play any of the instruments on the recording.

To get that final chord on "A Day In The Life" to sound the way they wanted it to they brought three grand pianos into the studion and John, Paul, Ringo and Mal Evans all hit certain keys simultaneously and held them down, and they also turned the recoding gain up as high as it would go so they could continue to get the chord on tape or as long as possible. I think it was a E chord?

Ringo's lead vocal on "With A Little Help" was done at like 6 AM after an all night session doing the tracks and overdubs for the song. He was trecking up the steps to go home at 5:30 AM when the other three guys cajoled him into coming back and doing the lead vocal then.

It was also supposedly the first rock album to print all of the lyrics to every song on the back cover.

\"jordy\

1/4/2014 5:43:00 PM

0



"A day in the life" is one of the Beatles best songs... not only that, it is one of the best songs of all time, Imo...

Willie

1/4/2014 7:03:00 PM

0

On Saturday, January 4, 2014 12:42:52 PM UTC-5, Jordy Chase wrote:
> "A day in the life" is one of the Beatles best songs... not only that, it is one of the best songs of all time, Imo...

I like this version, sacrilegious though it be:

http://thebeatlescompleteonukulele.bandcamp.com/track/a-day-in-the-life-er...

Makes me imagine a British businessman in fancy shoes.

\"jordy\

1/4/2014 9:16:00 PM

0


Pink Floyd's "Dark Side of the moon" is the best concept album, Imo... yes, it's terribly overplayed on classic rock stations, but it's still so much better than Pink Floyd's "The Wall"...

\"jordy\

1/4/2014 9:18:00 PM

0


Bob Dylan didn't like Sgt Pepper at the time, saying it was too "self indulgent"... I wonder if he has listened to it since, and if he has revised his opinion or not...

Just Walkin'

1/4/2014 10:35:00 PM

0

This is exactly the point. Form follows function. The "concept album" was a new revenue generator that didn't (necessarily) include the singles, which had to be purchased separately.

As with Bob, marketing of The Beatles led to very innovative merchandising campaigns. Quite a business turning rebellion into money and institutionalizing the set of relations that led to the subordination of the creative impulse to the profit motive. In this way, the lyrics didn't matter; they were only bait.

poisoned rose

1/4/2014 10:45:00 PM

0

"Just Walkin'" <kenshain@comcast.net> wrote:

> This is exactly the point. Form follows function. The "concept album" was a
> new revenue generator that didn't (necessarily) include the singles, which
> had to be purchased separately.
>
> As with Bob, marketing of The Beatles led to very innovative merchandising
> campaigns. Quite a business turning rebellion into money and
> institutionalizing the set of relations that led to the subordination of the
> creative impulse to the profit motive. In this way, the lyrics didn't matter;
> they were only bait.

Every post from you is the same. But you forgot to include "hegemony"
this time.

really real

1/4/2014 11:31:00 PM

0


> This is exactly the point. Form follows function. The "concept album" was a new revenue generator that didn't (necessarily) include the singles, which had to be purchased separately.
>

The concept album was about art. Good art sold well, back then.

Leaving the singles off the LPs was a British concept for their more
impoverished record buying kids. The kids bought the singles, and didn't
need another copy of them on the albums.

Sgt Pepper was the first Beatles album to be released in the same form
in the US and Great Britain. That's why the singles weren't on it.

The Bloomfield Bloviator

1/4/2014 11:49:00 PM

0

On Saturday, January 4, 2014 6:30:43 PM UTC-5, really real wrote:

> Sgt Pepper was the first Beatles album to be released in the same form in the US and Great Britain.

There's a small diference. The UK pressings have that dumb little ditty that comes on about 15 seconds after "A Day In The Life" ends. That was not on the USA pressings back then.