rubinius/rubinius — pull request #1447 by robgleeson (2011-12-11 08:26:44+00:00)
Title: Add a implementation for String#ascii_only?

There are two failing tests left, one I think could be easily fixed when
Encoding#ascii_compatible? gets implemented, probably with:

```ruby
if empty? && encoding.ascii_compatible? == false
return false
end
```

The other assertion I'm not entirely sure the point of:

```ruby
it "returns false for the first non-US-ASCII single-character String" do
chr = 128.chr
chr.encoding.should == Encoding::ASCII_8BIT
chr.ascii_only?.should be_false
end
```

It fails on `chr.encoding.should == Encoding::ASCII_8BIT`, but the test passes without this line. I don't think that assertion has much to do with an implementation of `Encoding#ascii_only?`, but I didn't remove it incase I'm overlooking something.