Closed eregon closed 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.
@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?
@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.
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.
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!
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
object&.foo
, method #foo is called onobject
if it is not nil. this is similar totry!
in Active Support, except:obj.try! {}
# validobj&. {}
# syntax errorobj.try!(:foo, bar()) # bar() is always evaluated
obj&.foo(bar()) # bar() is conditionally evaluated
obj&.attr += 1
Feature #11537did_you_mean
gem:<<~
. refer doc/syntax/literals.rdoc for more details. Feature #9098Core classes updates (outstanding ones only)
exception: false
like IO#read_nonblock. Feature #11358flags
is added. this parameter is bitwise-ORed to oflags generated by normal mode argument. Feature #11253encoding
. Feature #11785Core classes compatibility issues (excluding feature bug fixes)
Stdlib updates (not pure-Ruby changes as these just depend on existing features)
exception: false
.exception: false
to return :wait_readable or :wait_writable symbols instead of raising IO::WaitReadable or IO::WaitWritable exceptions [Feature #10532] Feature #11229Stdlib compatibility issues (not pure-Ruby changes as these just depend on existing features)
C API updates