[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Unit testing questions

Patrick Hurley

10/26/2006 5:39:00 PM

I have been working on a msg4r wrapper that provides a number of
messaging clients (i.e. Websphere MQ, ActiveMQ, Stomp) to ruby all
with that same API. I have some simple unit tests in place that
require the actual messaging systems to be available - this mean that
there is significant work required to setup the test, but when they
run I know that they are actually working. I am considering some sort
of mock approach, but I fear that I will be missing out on testing the
specifics of the wire protocols, timing etc.

I am not sure if there is a "right" answer, but I was wondering if
there were any ideas/hints other developers might have.

Thanks
pth

6 Answers

Tim Pease

10/26/2006 6:19:00 PM

0

On 10/26/06, Patrick Hurley <phurley@gmail.com> wrote:
> I have been working on a msg4r wrapper that provides a number of
> messaging clients (i.e. Websphere MQ, ActiveMQ, Stomp) to ruby all
> with that same API. I have some simple unit tests in place that
> require the actual messaging systems to be available - this mean that
> there is significant work required to setup the test, but when they
> run I know that they are actually working. I am considering some sort
> of mock approach, but I fear that I will be missing out on testing the
> specifics of the wire protocols, timing etc.
>
> I am not sure if there is a "right" answer, but I was wondering if
> there were any ideas/hints other developers might have.
>

If you have tests that work, why change them?

Here are my reasons for using mock objects:
1) fixture is too complex to configure for unit testing
2) you do not have control over the entire system (i.e. talking to a
remote web service)
3) you are controlling an external device that could be damaged

Mock objects are great, but they require work to maintain. If you can
test without them, great! One less thing to modify when the system
needs to change.

If you are constrained by 1, 2, or 3, then you cannot live without mock objects.

I've used Jim Weirich's FlexMock, and I'd highly recommend it. A
fellow rubyist has recommended MockFS for mocking out the entire file
system.

Blessings,
TwP

http://onestepback.org/software...
http://rubyforge.org/projec...

Ken from Chicago

12/5/2011 2:10:00 PM

0

"Steve Bartman" <sbartman@visi.com> wrote in message
news:esnid7do5og7l9cudhrj8fvl068qoaf60c@4ax.com...
> On Fri, 02 Dec 2011 13:54:11 -0500, Mason Barge <masonbarge@gmail.com>
> wrote:
>
>>On Thu, 1 Dec 2011 21:39:13 -0600, "Ken from Chicago"
>><kwicker1b_nospam@comcast.net> wrote:
>>
>>>MSNBC's Morning Joe has a new promo:
>>>
>>>http://www.youtube.com/watch?v=p...
>>>
>>>Gauntlet has been tossed down, ABC's Good Morning America, CBS' Early
>>>Show,
>>>CNN's American Morning, Fox News' Fox and Friends & NBC's Today.
>>>
>>>-- Ken from Chicago
>>
>>Yeah that's great! I love the Pan Am/Charlie's Angels shot of the three
>>women's legs walking in high heels.
>
> Except, if you watch the show every day as I do, they've shown it, and
> shown it, and shown it . . .
>
> Enough.
> Steve

They do split it up for solo features of Mika, Willie and Joe separately.

-- Ken from Chicago

Ken from Chicago

12/5/2011 2:10:00 PM

0

"Mason Barge" <masonbarge@gmail.com> wrote in message
news:bl7id75vna0g3j0mo2rd01nnoslg9lu4ct@4ax.com...
> On Thu, 1 Dec 2011 21:39:13 -0600, "Ken from Chicago"
> <kwicker1b_nospam@comcast.net> wrote:
>
>>MSNBC's Morning Joe has a new promo:
>>
>>http://www.youtube.com/watch?v=p...
>>
>>Gauntlet has been tossed down, ABC's Good Morning America, CBS' Early
>>Show,
>>CNN's American Morning, Fox News' Fox and Friends & NBC's Today.
>>
>>-- Ken from Chicago
>
> Yeah that's great! I love the Pan Am/Charlie's Angels shot of the three
> women's legs walking in high heels.

Those are *serious* *professional* business women. You can tell by their
serious unsmiling demeanor and walking in lockstep union.

-- Ken from Chicago

Steve Bartman

12/6/2011 6:28:00 AM

0

On Mon, 5 Dec 2011 08:10:12 -0600, "Ken from Chicago"
<kwicker1b_nospam@comcast.net> wrote:


>They do split it up for solo features of Mika, Willie and Joe separately.
>
>-- Ken from Chicago

Yeah, I know, but it's a, at best, joke-two-times.

Barnacle on the scooter and Donnie in the doorman outfit are the two
best bits IMO. The Soccer dude is good too.

I get tired of the Mika Show every day. She reminds me of a lot of
guys' first wives. I happen to agree with her politics more or less,
but she's just a killjoy. If the Boys want to talk sports, and they
shouldn't, the producers and directors should pull them back on-topic
during the breaks and after the show. It's not up to her to be the den
mother. She comes off shrill.







Steve

Obveeus

12/6/2011 12:04:00 PM

0


"Steve Bartman" <sbartman@visi.com> wrote:
> I get tired of the Mika Show every day. She reminds me of a lot of
> guys' first wives. I happen to agree with her politics more or less,
> but she's just a killjoy. If the Boys want to talk sports, and they
> shouldn't, the producers and directors should pull them back on-topic
> during the breaks and after the show. It's not up to her to be the den
> mother. She comes off shrill.

For whatever reason, the producers want her to come off that way, so they
have her regularly gripe about sports. Worse, though, is that they let her
tout her dietary/body image problems.


Steve Bartman

12/6/2011 6:12:00 PM

0

On Tue, 6 Dec 2011 07:04:28 -0500, "Obveeus" <Obveeus@aol.com> wrote:

>
>"Steve Bartman" <sbartman@visi.com> wrote:
>> I get tired of the Mika Show every day. She reminds me of a lot of
>> guys' first wives. I happen to agree with her politics more or less,
>> but she's just a killjoy. If the Boys want to talk sports, and they
>> shouldn't, the producers and directors should pull them back on-topic
>> during the breaks and after the show. It's not up to her to be the den
>> mother. She comes off shrill.
>
>For whatever reason, the producers want her to come off that way, so they
>have her regularly gripe about sports. Worse, though, is that they let her
>tout her dietary/body image problems.
>
Yeah, I forgot that one. I get it ! You work out!

My wife, who doesn't watch it as she goes off to a real job every day
at 0610, saw a bit on the Tivo. "Why does she do that with her face?"
she asked. There were so many possible answers.

The best part of the show to me is the table guests. They have some
brainiacs from different parts of the political and business spectrum,
and they actually talk to each other rather than hurl insults. Joe is
OK as long as he keeps the bombast to a Richter 7.0; at least he has
congressional cred. I'm not sure what Mika's cred is besides having a
famous, formerly powerful daddy.

I learned more about the current internal workings of the House
yesterday in ten minutes of back and forth between Barney Frank and
Joe S. than I have in weeks of watching MSNBC talking-head wannabes.

I get tired of the never ending SEC football stuff too, but it's
before dawn, I'm still asleep, and the guy time is welcome. I don't
need yet another Iowa Republican poll graphic shoved in my face, Mika.
There's three hours to fill. Give it a rest.


Steve