# Thread status tests

**URL:** <https://www.ruby-forum.com/t/thread-status-tests/157091>\
**Category:** IronRuby\
**Created:** [January 7, 2009, 10:02am UTC](https://www.ruby-forum.com/t/thread-status-tests/157091 "2009-01-07T10:02:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [January 7, 2009, 10:02am UTC](https://www.ruby-forum.com/t/thread-status-tests/157091/1 "2009-01-07T10:02:13Z")

</div>

There are four ways to check the status of threads, Thread#status,  
Thread#inspect, Thread#alive?, and Thread#stop?. Any objection to adding  
a single shared file which checks the result of all the four APIs? It  
won’t follow the standard pattern of it\_behaves\_like for aliases since  
these are all different APIs and not aliases. However, it will help  
check all of them consistently. I wanted to check if this idea made  
sense before pushing in that direction.

Thanks,  
Shri

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [January 7, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/thread-status-tests/157091/2 "2009-01-07T20:27:59Z")

</div>

I would rather implement them all separately. They all act differently.  
Status returns a simple string, inspect returns an inspection string,  
and alive and stop are Boolean. I would leave the shared pattern for the  
way it is now. You can probably take advantage of sharing methods in the  
fixtures.

JD

From: Shri B.  
Sent: Wednesday, January 07, 2009 12:43 AM  
To: Jim D.  
Cc: removed\_email\_address@domain.invalid  
Subject: Thread status tests

There are four ways to check the status of threads, Thread#status,  
Thread#inspect, Thread#alive?, and Thread#stop?. Any objection to adding  
a single shared file which checks the result of all the four APIs? It  
won’t follow the standard pattern of it\_behaves\_like for aliases since  
these are all different APIs and not aliases. However, it will help  
check all of them consistently. I wanted to check if this idea made  
sense before pushing in that direction.

Thanks,  
Shri

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [January 7, 2009, 8:44pm UTC](https://www.ruby-forum.com/t/thread-status-tests/157091/3 "2009-01-07T20:44:28Z")

</div>

Yeah, I can probably unify the fixtures but leave the expectations in  
the individual spec files.

From: Jim D.  
Sent: Wednesday, January 07, 2009 11:25 AM  
To: Shri B.  
Cc: removed\_email\_address@domain.invalid  
Subject: RE: Thread status tests

I would rather implement them all separately. They all act differently.  
Status returns a simple string, inspect returns an inspection string,  
and alive and stop are Boolean. I would leave the shared pattern for the  
way it is now. You can probably take advantage of sharing methods in the  
fixtures.

JD

From: Shri B.  
Sent: Wednesday, January 07, 2009 12:43 AM  
To: Jim D.  
Cc: removed\_email\_address@domain.invalid  
Subject: Thread status tests

There are four ways to check the status of threads, Thread#status,  
Thread#inspect, Thread#alive?, and Thread#stop?. Any objection to adding  
a single shared file which checks the result of all the four APIs? It  
won’t follow the standard pattern of it\_behaves\_like for aliases since  
these are all different APIs and not aliases. However, it will help  
check all of them consistently. I wanted to check if this idea made  
sense before pushing in that direction.

Thanks,  
Shri
