rubyspec/rubyspec — pull request #170 by eregon (2012-12-30 14:42:35+00:00)
Title: Fix hanging tests on 1.8

Hello,

I ran rubyspec with latest MRI 1.8 (ruby 1.8.7 (2012-10-12 patchlevel 371) [i686-darwin10.8.0]) and a few specs hang.

I had to run with 3 exclusion:

* File.open on a FIFO opens it as a normal file: the fifo is never open'd by File.open()
* ConditionVariable#signal releases the first thread waiting in line for this resource: the line `Thread.pass until r2.size == i+1` hangs as `r2.size` is immediately 100 (so the signal seems broadcasted).
* TCPServer#gets raises Errno::ENOTCONN on gets: this hangs if run with the whole suite.

```bash
../mspec/bin/mspec run --verbose -B ruby.1.8.mspec -P 'File.open on a FIFO opens it as a normal file|TCPServer#gets raises Errno::ENOTCONN on gets|ConditionVariable#signal releases the first thread waiting in line for this resource' -t ruby
```

With this the suite does not hangs and does not error on parsing.

I had to make two changes:

* quote non-ASCII Symbols in `core/symbol/encoding_spec.rb` as they do not parse in 1.8. If the spec wants to test syntax, then it should probably be in another place, and the file excluded from `ruby.1.8.mspec`.
* add a couple `Thread.pass` in thread loops as they would never give up execution. This is only necessary in MRI 1.8, so it might be wise to enable it only for MRI 1.8