infused/dbf — pull request #30 by chrislwade (2011-12-10 05:59:23+00:00)
Title: update specs to work with 1.8.6 and update supported versions

I was validating my code (the in-memory-dbf changes) against all the listed versions and came across the fact that several specs fail against 1.8.6.

It seems as though the specs for `DBF::Table` assume `Enumerable#count` exists which isn't the case for 1.8.6, it was introduced in 1.8.7. This impacts every usage of the following spec:

```ruby
# file_format_spec.rb:15
specify "record count should be the same as reported in the header" do
@table.count.should == @table.record_count
end
```

The same is true for `Enumerable#first`.

```ruby
# table_spec.rb:169
it "should return the first record if options are empty" do
@table.find(:first).should == @table.first
end
```

The following spec was also failing because the sort order of `Hash#keys` doesn't match the defined list for 1.8.6:

```ruby
# table_spec.rb:4
specify 'foxpro versions' do
DBF::Table::FOXPRO_VERSIONS.keys.should == %w(30 31 f5 fb)
end
```

Since the code itself seems to work (per the specs anyway) once the specs themselves are updated to work with 1.8.6 this pull request simply does exactly that. I've also gone ahead and tested against MRI 1.9.1, REE 1.8.7 and JRuby 1.6.3-1.6.5 and updated the tested version list to reflect the same.

Finally, as of rspec-core 2.7.1, a call to `Enumerable#reduce` was added within rspec itself that causes all the specs to fail on 1.8.6. To fix this I've added a conditional monkey-patch in spec_helper.rb to alias `inject` as `reduce`. There's fix in rspec-core master to resolve this as of the next release, at which point this patch can be removed.