ruby / spec

The Ruby Spec Suite aka ruby/spec
MIT License
600 stars 389 forks source link

Ruby 2.3 specs #175

Closed eregon closed 8 years ago

eregon commented 8 years ago

We should aim to write specs for all new features, as usually the coverage is rather limited and it would greatly help other implementations to get the behavior right and faster.

From https://github.com/ruby/ruby/blob/v2_3_0/NEWS: Only relevant items are kept for brevity.

Changes since the 2.2.0 release

Language changes

eregon commented 8 years ago

About Hacktoberfest: any PR with specs covering one of those points would greatly help Ruby implementations and help to specify Ruby's 2.3 behavior! There are plenty of existing specs to take inspiration from. Find me on #rubyspec on Freenode or just create an issue or PR to discuss.

iliabylich commented 8 years ago

@eregon Working on adding specs for "squiggly heredoc" from https://github.com/opal/opal/pull/1397. I guess all specs must be wrapped with eval, right? Is it possible to exclude the whole file from the test suite by specifying required ruby version? I just feel that wrapping all those heredocs with eval may look scary.

Or can we extract all examples to a separate file and required it in a context of ruby_version_is "2.3"? In https://github.com/ruby/spec/pull/318 require happens directly in the test. Does moving to an outer context break anything?

eregon commented 8 years ago

@iliabylich Thanks! Fixtures files is the best for this.

Or can we extract all examples to a separate file and required it in a context of ruby_version_is "2.3"?

Yes, it's OK to require within the version guard, I moved it since it was used in a single spec.

eregon commented 8 years ago

All new features of 2.3 are now finally properly specified in ruby/spec!

We need a better way to deal with this, it's too time consuming. Ideally, people implementing the features would also contribute a spec. MRI tests are often not optimal due to testing many different aspects together, making it very likely to fail for reasons unrelated to the new feature on alternative Ruby implementations.

eregon commented 8 years ago

I would like to thank @headius, @mjago, @sgarciac and @iliabylich for the big help on these specs! :tada: We would not make it without you!