Test::Unit advice - blocking method

D

Daniel Berger

Hi all,

I've got a method in the win32-clipboard library, Clipboard.notify_change,
that blocks until something changes in the clipboard. But I'm not sure how
to test it.

Basically, here's what I'm trying to accomplish:

def test_notify_change
assert_nothing_raised{ Clipboard.notify_change } # This will block
until something happens
assert_nothing_raised{ Clipboard.set_data('test') } # This should trigger
the notify_change method
end

I tried using a thread within the test itself but it didn't work right. I
was probably doing something wrong.

Any suggestions?

Regards,

Dan
 
R

Roger Pack

I tried using a thread within the test itself but it didn't work right.
I
was probably doing something wrong.

Any suggestions?

maybe use 1.9 with thread_blocking_region's? Maybe use two processes?
Just thinking out loud.
=r
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top