Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bae6fd038f72
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 66fcdb09cae9
Choose a head ref
  • 2 commits
  • 635 files changed
  • 1 contributor

Commits on Jun 2, 2015

  1. Squashed 'spec/ruby/' changes from a27965a..ac1063b

    ac1063b Add spec for break in a block executed inside a while.
    458e964 JRuby now supports Socket.[socket]pair.
    a87ce01 Remove implementation and version specific Hash#compare_by_identity specs that are already tested elsewhere.
    418eedf Fix wording and only specify the behavior when it was actually defined for Hash#reject.
    0c28bab Add spec for Array#flatten coersion protocols.
    d7fd4fe BigDecimal basic operations improvements, comparisons, to_s
    d20e2ef More zsuper specs.
    37b925e New specs for zsuper with rest arguments.
    e52ffab New specs for zsuper with optional arguments.
    a63f86e Specs for Digest.bubblebabble.
    594b1b0 Fix title for Module#remove_method arguments spec.
    f486f6b Actually call a not defined method in method_missing spec.
    4bc9586 Merge pull request #71 from JuanitoFatas/regexp/character-properties
    745b346 Fix syntax on Regexp character classes spec.
    6d10977 [RegExp] Add specs for Han, Hiragana, Katakana, Hangul character properties
    e0769b6 Move the platform guard inside the shared describe.
    abd2fe3 Allow failure for OSX ruby-head until it is fixed.
    6443f12 Filesystem encoding is fixed on Windows and Darwin
    dcc1f6a Acknowledge a bug which will be fixed in 2.2.3.
    e5272ff Allow all orders for instance variables in marshaled Time.
    8a31ccd Revert "Fix Marshal spec of Time depending on zone encoding fo recent 2.2."
    ec87bc5 Cleanup the .gitignore.
    07a7665 Revert "Merge branch 'update-osx'"
    de076a2 Merge branch 'update-osx'
    1d34c37 Revert "Try to be more precise in the Ruby 2.2 version for OS X."
    0149116 Merge branch 'master' into update-osx
    b6188ca Try to be more precise in the Ruby 2.2 version for OS X.
    82b3c0a use latest osx image
    2fc96f5 Dir.glob results are now always in the encoding of the pattern
    904793f Add OS X on Travis.
    a994187 Merge pull request #69 from benlovell/resolve-utf8-issues
    5cb8912 Fixes misnamed UTF_8 constant
    a1603be Extract the way to find an available port in socket specs.
    dd8ad27 Unify style of {before,after} :{all,each}.
    ecac528 Refactor Dir[] and Dir.glob specs.
    59cd27d Fix typo.
    5d0495b Fix Dir.glob and Dir[] encoding specs.
    72e4b19 Enable default Travis CI notifications.
    0a9bcbd Replace the last instances of raise_exception by raise_error.
    68d4b03 Remove usage of stasy.
    faf8c80 Remove deprecated STR2CSTR and rb_str2cstr CAPI specs.
    4ecf19c Remove deprecated RSTRING() CAPI specs.
    9079acb Remove deprecated RFLOAT() CAPI specs.
    7f7ef81 Remove deprecated RARRAY() macro specs.
    06b367f Cleanup CAPI specs assuming Ruby >= 2.0.
    c503e0f rb_hash_size is available only in MRI 2.2.
    b9418f6 Enable rb_set_errinfo specs.
    831e525 Remove most occurences of 1.9 in the comments.
    fe74e42 Remove the encoding_transition feature.
    239e74a Fix Math.atanh specs.
    6f48a2a rb_enc_associate_index on a Symbol differs in 2.1.
    6294fbc MRI 2.1 has rb_hash_size.
    738ebd4 Remove most 1.8-related comments.
    9abbb8a Add spec for ARGF.close with STDIN.
    8fcf35b Remove 1.8.7-only conditional.
    7fdaf96 Remove guard hack for Process.daemon, just use tags instead.
    dfdd7f3 Merge and share specs for Time, Date and DateTime #strftime.
    c353515 Added missing terminating newlines
    5268769 Merge pull request #65 from benlovell/specify-implicit-procs
    f2a354e Prefer `#call` over `#()`
    6cfc6fb Merge pull request #66 from ruby/remove-net-telnet
    59ac739 removed net-telnet specs
    b4c0863 Minor fixes to the README
    ba948d0 Link to CONTRIBUTING.md
    416556d Create  CONTRIBUTING.md
    14a5a01 This is now the canonical RubySpec.
    8480f73 Fix README quotes and add another way to use MSpec
    4fd4d6d Simplify the README instructions to run RubySpec
    c1e6a7f Merge pull request #64 from pxlpnk/patch-1
    4554dad Specifies creation of a `lambda`
    1657856 Update GitHub urls in README
    09253a8 Update README.
    0fbfb15 Only use :: for constant resolution and call class methods with a dot.
    ea69464 Do not try to load prime twice.
    80119c3 Improve precision of a Prime#each assertion.
    94ceed8 Remove duplicated specs for Prime.
    543fc33 Merge pull request #63 from Nullset14/master
    d8899ff remove new_spec.rb. remove Prime.instance.each reference
    3e0181e Guard 2.1-only syntax with an eval.
    39a6aa4 change to Prime.instance.each instead of Prime.each
    8c523ffd remove Prime.new tests
    6cb1984 change Prime.instance.each to Prime.instance
    c994e6f remove support for obsolete Prime.new
    
    git-subtree-dir: spec/ruby
    git-subtree-split: ac1063b9ff5ac8514c174fe68e2ae1d7f155ae35
    eregon committed Jun 2, 2015
    Copy the full SHA
    c62e81d View commit details
  2. Copy the full SHA
    66fcdb0 View commit details
Showing 635 changed files with 1,940 additions and 2,798 deletions.
23 changes: 2 additions & 21 deletions spec/ruby/.gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
.rbx
*.rba
*.rbc
*.swp
.DS_Store
*~
\#*\#
.\#*\#
/default.mspec
/nbproject/private
*.orig
*.rej
optional/ffi/fixtures/build
jruby.1.8.mspec
jruby.1.9.mspec
rubyspec_temp
Gemfile.lock

*.bundle
*.dylib
*.so
*.dll
rubyspec_temp
spec/rubyspec/optional/capi/ext
15 changes: 10 additions & 5 deletions spec/ruby/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
language: ruby
script:
- bundle exec mspec -fd -t ruby
notifications:
email: false
os:
- linux
- osx
rvm:
- 2.0.0
- 2.1
- 2.2
- 2.2.2
- ruby-head
script:
- bundle exec mspec -fd -t ruby
matrix:
allow_failures:
- os: osx
rvm: ruby-head
12 changes: 12 additions & 0 deletions spec/ruby/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Contributions are much appreciated.
Please open a pull request or add an issue to discuss what you intend to work on.
If the pull requests passes the CI and conforms to the existing style of specs, it will be merged.

### Creating files for currently unspecified modules or classes

If you want to create specs for a module or class and the files do not exist yet,
you should use `mkspec`, part of [MSpec](http://github.com/ruby/mspec):

$ path/to/mspec/bin/mkspec -h

Specify `core` or `library` as the `base`.
114 changes: 36 additions & 78 deletions spec/ruby/README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,68 @@
# A RubySpec fork for CRuby
# RubySpec

[![Build Status](https://travis-ci.org/ruby/rubyspec.png)](https://travis-ci.org/ruby/rubyspec)

## FAQ
RubySpec is an executable specification for the Ruby programming language.
The specs describe the Ruby language syntax as well as the core and standard library classes.

### Why fork?
The RubySpec files are written using a RSpec-like syntax.
MSpec is the purpose-built framework for running RubySpec.
For more information, see the [MSpec](http://github.com/ruby/mspec) project.

Because RubySpec often include [tests which fails on CRuby](http://rubyci.blob.core.windows.net/centos5-64/ruby-trunk/log/20130220T070302Z.diff.html.gz) even if RubySpec is a test suite which verifies whether an implementation is compatible with CRuby or not.
Moreover recent mspec can't ignore specs guarded with ruby\_bug. It breaks running RubySpec because those guards are used to avoid specs which hang or crash.
### Running the specs

### Do you receive pull requests?
The easiest way to run the RubySpec suite is to use Bundler.
If you do not have Bundler yet, you can install it with:

Yes. If the pull request won't break anything, it will be merged.
$ gem install bundler

## Original Readme
Then, to install the MSpec dependency, just do:

RubySpec is an executable specification for the Ruby programming language. The
specs describe Ruby language syntax as well as the core and standard library
classes. See http://rubyspec.org for more information.

The RubySpec files are written using RSpec-compatible syntax. MSpec is a
purpose-built framework for running RubySpec. For more information, see the
http://github.com/rubyspec/mspec project.

[![Build Status](https://travis-ci.org/rubyspec/rubyspec.png)](https://travis-ci.org/rubyspec/rubyspec)

1. Installing MSpec

The easiest way to run the RubySpecs suite is to install the MSpec gem.

$ [sudo] gem install mspec

Once the gem is installed, the 'mspec' executable will be available and all
the commands shown below should run.

However, RubySpec often utilizes the latest MSpec features, so you may want to
use MSpec directly from the Git repository.

$ cd /somewhere
$ git clone git://github.com/rubyspec/mspec.git

MSpec is now available in '/somewhere/mspec'.

To make the MSpec scripts available, add the MSpec 'bin' directory to you
PATH:

$ export PATH=/somewhere/mspec/bin:$PATH

Once you have MSpec installed, clone the RubySpec Git repository to run the
specs.

$ cd /somewhere
$ git clone git://github.com/rubyspec/rubyspec.git
$ cd path/to/rubyspec
$ bundle install

To run the RubySpec suite:

$ cd /somewhere/rubyspec
$ mspec

This will execute all the RubySpec specs using the executable named 'ruby' on
your current PATH.
$ bundle exec mspec

Alternatively, you can clone [MSpec](http://github.com/ruby/mspec) and run the specs with:

2. Running Specs with a Specific Ruby Interpreter
$ cd path/to/rubyspec
$ cd ..
$ git clone https://github.com/ruby/mspec.git
$ cd rubyspec
$ ../mspec/bin/mspec

Use the '-t' option to specify the Ruby implementation with which to run the
specs. The argument may be a full path to the Ruby binary. For example, to run
RubySpec against '/opt/ruby-enterprise/bin/ruby':
This will execute all the RubySpec specs using the executable named `ruby` on your current PATH.

$ mspec -t /opt/ruby-enterprise/bin/ruby
### Running Specs with a Specific Ruby Implementation

There are some arguments that are abbreviations for known Ruby implementations.
For example, if you specify 'j', then MSpec will look for 'jruby' in PATH and
run RubySpec against that:
Use the `-t` option to specify the Ruby implementation with which to run the specs.
The argument may be a full path to the Ruby binary.

$ mspec -t j
$ mspec -t /path/to/some/bin/ruby

See 'mspec --help' for a list of '-t' abbreviations.
### Running Selected Specs


3. Running Selected Specs

To run a single spec file, pass the filename to 'mspec':
To run a single spec file, pass the filename to `mspec`:

$ mspec core/kernel/kind_of_spec.rb

You can also pass a directory, in which case all specs in that directories
will be run:
You can also pass a directory, in which case all specs in that directories will be run:

$ mspec core/kernel

Note however that passing a directory to MSpec may not always be a good idea,
because some specs are language version specific. While there are version
guards in the specs for version-specific behaviors, some classes and libraries
are only for one Ruby version.
Finally, you can also run them per group as defined in `default.mspec`.
The following command will run all language specs:

RubySpec provides configuration files that include or exclude some spec
directories based on language version. MSpec provides an option to run these
sets of specs. The sets are divided by the natural divisions in RubySpec.
$ mspec :language

The following command will run all core library specs specific to the language
version:
In similar fashion, the following commands run the respective specs:

$ mspec :core
$ mspec :library
$ mspec :capi

In similar fashion, the following commands run the respective specs:
### Contributing

$ mspec :library
$ mspec :language
See [CONTRIBUTING.md](https://github.com/ruby/rubyspec/blob/master/CONTRIBUTING.md).
17 changes: 2 additions & 15 deletions spec/ruby/core/argf/close_spec.rb
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
end

ruby_version_is ""..."2.3" do
# This passes on 1.9 and 1.8 HEAD, but fails on 1.8.7 and 1.8.6
it "raises an IOError if called on a closed stream" do
argv [@file1_name] do
lambda { ARGF.close }.should_not raise_error
@@ -43,19 +42,7 @@
end
end

# This passes on 1.8.6 and 1.8.7 but fails on 1.9. matz confirmed that it
# should pass in the referenced bug report.
#
# This is quarantined because closing STDIN easily destabilizes specs that
# run after this. If this is to be spec'd, it must be done in a subprocess
# or in some kind of isolation.
quarantine! do
it "can close STDIN" do
argv ['-'] do
ARGV.size.should == 1
ARGF.close.should == ARGF
ARGF.closed?.should be_true
end
end
it "does not close STDIN" do
ruby_exe("ARGV.replace(['-']); ARGF.close; print ARGF.closed?").should == "false"
end
end
2 changes: 1 addition & 1 deletion spec/ruby/core/argf/shared/each_line.rb
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

it "is a public method" do
argv [@file1_name, @file2_name] do
ARGF.public_methods(false).should include(stasy(@method))
ARGF.public_methods(false).should include(@method)
end
end

2 changes: 1 addition & 1 deletion spec/ruby/core/array/fill_spec.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
require File.expand_path('../fixtures/classes', __FILE__)

describe "Array#fill" do
before(:all) do
before :all do
@never_passed = lambda do |i|
raise ExpectationNotMetError, "the control path should not pass here"
end
4 changes: 2 additions & 2 deletions spec/ruby/core/array/join_spec.rb
Original file line number Diff line number Diff line change
@@ -33,11 +33,11 @@
end

describe "Array#join with $," do
before(:each) do
before :each do
@before_separator = $,
end

after(:each) do
after :each do
$, = @before_separator
end

2 changes: 1 addition & 1 deletion spec/ruby/core/array/permutation_spec.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

describe "Array#permutation" do

before(:each) do
before :each do
@numbers = (1..3).to_a
@yielded = []
end
2 changes: 1 addition & 1 deletion spec/ruby/core/array/repeated_permutation_spec.rb
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

describe "Array#repeated_permutation" do

before(:each) do
before :each do
@numbers = [10, 11, 12]
@permutations = [[10, 10], [10, 11], [10, 12], [11, 10], [11, 11], [11, 12], [12, 10], [12, 11], [12, 12]]
end
4 changes: 2 additions & 2 deletions spec/ruby/core/array/shared/join.rb
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@
require File.expand_path('../../fixtures/encoded_strings', __FILE__)

describe :array_join_with_default_separator, :shared => true do
before(:each) do
before :each do
@separator = $,
end

after(:each) do
after :each do
$, = @separator
end

2 changes: 1 addition & 1 deletion spec/ruby/core/array/shared/keep_if.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
end

describe "on frozen objects" do
before(:each) do
before :each do
@origin = [true, false]
@frozen = @origin.dup.freeze
end
2 changes: 0 additions & 2 deletions spec/ruby/core/basicobject/instance_eval_spec.rb
Original file line number Diff line number Diff line change
@@ -99,8 +99,6 @@ def foo
prc.call(false, prc).should == 1
end

# On 1.9 class variables aren't inherited so we have to modify the test
# from 1.8
it "sets class variables in the receiver" do
BasicObjectSpecs::InstEvalCVar.class_variables.should include(:@@count)
BasicObjectSpecs::InstEvalCVar.send(:class_variable_get, :@@count).should == 2
2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/bit_and_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#&" do
before(:each) do
before :each do
@bignum = bignum_value(5)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/bit_or_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#|" do
before(:each) do
before :each do
@bignum = bignum_value(11)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/bit_xor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#^" do
before(:each) do
before :each do
@bignum = bignum_value(18)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/divmod_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#divmod" do
before(:each) do
before :each do
@bignum = bignum_value(55)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/element_reference_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#[]" do
before(:each) do
before :each do
@bignum = bignum_value(4996)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/exponent_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#**" do
before(:each) do
before :each do
@bignum = bignum_value(47)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/gt_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#>" do
before(:each) do
before :each do
@bignum = bignum_value(732)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/gte_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#>=" do
before(:each) do
before :each do
@bignum = bignum_value(14)
end

2 changes: 1 addition & 1 deletion spec/ruby/core/bignum/left_shift_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe "Bignum#<< with n << m" do
before(:each) do
before :each do
@bignum = bignum_value() * 16
end

Loading