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: ee137a851d35
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 62248650800d
Choose a head ref
  • 5 commits
  • 392 files changed
  • 1 contributor

Commits on Apr 28, 2017

  1. Squashed 'spec/mspec/' changes from 815ee35..8604276

    8604276 Explicitly capture the exception rather than relying on $!
    4ba7a1c Ensure to load a given config file only once
    653a4f2 Return early if $VERBOSE == nil in our Kernel#warn
    c5493b8 Suppress warning for mruby
    f00154f Kernel#warn delegates to Warning.warn in 2.5
    954054c Use Warning.warn and filter warnings on Ruby >= 2.4
    9084b1a Fix failure messages for the complain matcher
    d800cc0 Add a space after the spinner
    2dec262 Remove the :dir option of ruby_exe
    422ec3f Remove unused be_valid_DNS_name helper
    7409884 Remove unused be_computed_by_function matcher
    f6752d2 Use a more precise test for SPEC_TEMP_DIR
    78c25b6 Remove unused #encode helper
    0acde1e Remove unused equal_utf16 matcher
    0e051ef Remove ducktype helpers respond_to, does_not_respond_to, undefine and fake!
    c43b12e Use interpolation
    cbe5276 Build a single instance of the full Ruby version for version guards
    206fb6d Reuse BigEndianGuard for little_endian
    0f302fd Implement as_user with SuperUserGuard
    fb2e2e1 Refactor guards in terms of SpecGuard#run_if and #run_unless
    05f61ba Remove unused SpecGuard#===
    b3e2274 Revert "New feature: automatic alias detection for shared describes"
    3c91dfd Simplify PlatformGuard by replacing .platform? by .os?
    0d4c430 Simplify PlatformGuard.os?
    d764519 Move platform-related guards to PlatformGuard as class methods
    e7e1c8d Simplify SpecGuard#implementation?
    97056be Raise on unknown implementation
    de6a3db Assign SpecGuard @parameters directly
    455b37d Save guards arguments consistently in @parameters
    2d80202 Remove old aliases for --target
    6bc027d Prefer ! to the not keyword
    ac10ab7 Remove unused with_tty guard
    9304394 Remove unused runner_is/runner_is_not guards
    6a3bbba Remove deprecated extended_on guard
    cbb7e27 Remove compliance guards: compliant_on, not_compliant_on, deviates_on
    b3089d3 Remove unused unspecified and specified_on guards
    fc64021 Remove deprecated raise_exception alias
    c1de623 Remove deprecated have_data matcher
    0ba63fe Remove deprecated hash_class and new_hash helpers
    65d20c3 Remove deprecated stasy helper
    99c8814 Remove singleton_class helper, it is standard Ruby
    5cc2cf0 Remove deprecated enumerator_class
    8e8988c Remove unused home_directory helper
    84f5870 Remove unused hostname helper
    5b9f1ed Remove unused method
    aa103d1 Remove unused dev_null helper
    386166f Remove unused #username helper
    1c4a2d3 Use ENV instead of shelling out
    e26e0a3 Remove unused #env helper
    1f64bb5 Fix PlatformGuard.opal?
    488ee67 Use a sensible implementation for the abstract SpecGuard#match?
    ae78872 Remove unused SpecGuard#ruby_version_override
    cc56b44 Remove the --background option
    245a9e8 Test that running mspec-run directly works as expected
    2c30be2 Share common output in run integration specs
    76268e0 Add tool to remove old version guards in ruby/spec
    11cb22f Move require 'etc' to where it is needed
    f64f5ec Use Etc.nprocessors
    42e9c9b Update Ruby versions for Travis
    55568ea Drop support for Ruby < 2.2
    bcfb181 Don't exclude constants from the stdlib in NameMap
    1754624 Pass --unguarded in mkspec to also see specs on other platforms
    14464e1 Allow to generate specs for Etc with mkspec
    3db264b Should fail if any worker failed
    f764643 Add an intergation test for mspec -j
    ba0236c Run no more processes than spec files
    aec10fd Warn about using "" as the end of a version Range
    2d4578b Add a few specs for version Range starting with an empty String
    06cae5a Deprecate ruby_bug without a version Range
    33e7136 Use the helper to hide our own deprecations in tests
    6856ff8 Support a version Range for ruby_bug
    5404094 Rename the config key for -I to :loadpath
    61d2f84 Initialize other config keys in MSpecMain
    
    git-subtree-dir: spec/mspec
    git-subtree-split: 8604276a6cdfd83c85aecfccfe32f6cea8acab8a
    eregon committed Apr 28, 2017
    Copy the full SHA
    f55cff5 View commit details
  2. Copy the full SHA
    9367f58 View commit details
  3. Squashed 'spec/ruby/' changes from 2e2057a..0db663b

    0db663b Fixed Math.log2 for huge Bignums.
    bc52723 Added {Bignum, Fixnum}.bit_length.
    aad92e8 Numeric timezone may not be bad
    1eb3d2f Add specs for rb_define_module
    8e8b5fd Fix SHELL env var passing
    f7ec5b7 Hide $IGNORECASE warnings
    344bd8d Use ruby_exe to reliably spawn a subprocess
    946abd5 Remove spec which only works before MRI 2.4.0
    e6665ae Add a spec for syntax errors in the script file and -e
    497931b Add new method spec with mixed parameter types.
    4042b46 Add large number example to String#% binary number format
    61acec4 Add String#% %p example with string argument
    9a8fd6d Add library specs for the English module
    ed5046a Updated incomplete String#encoding spec.
    279d4e0 Add instance_variable_defined? example testing various types where variable is not defined
    b89895d Fix typo in spec description
    4fefa64 Specs for true and false values being truthy and falsey in C
    1d8bcf0 Add another Time#zone bad zone example
    6af9b04 Add Module#alias_method spec to assert that aliased methods are == to eachother
    b2c2eeb Add Kernel#eval negative line number spec
    5c0bd7b Add BasicObject#instance_eval example with negative line number
    26d35a1 Spec that a splatted Array received in a rest argument is copied
    4a8d694 Only use literal values in the expected value
    4af8050 Add splat example where splatted array is modified by another argument
    1274e6a Add spec to update backtrace array in place
    11db149 It starts to look like something to unescape but it ends prematurely.  Do not expand (nor crash)
    c9e7f56 Allow .jar as extension of provided features
    c1f379e Reduce sleep time in Process.daemon specs
    24282dc Method#curry_spec: Be more explicit with simpler syntax
    ec31710 Move methods used only once closer to their usage
    1f537ff Move fixture closer to its only usage
    ca345d3 Revert "Kerenel#warn no longer splats an array in 2.5 (#382)" (#429)
    7beafc0 Handle warnings in MOdule#attr spec
    b79cf54 Concurrent requires show erroneous circular warnings
    acb27a7 Expect warnings for circular require
    c3256dc Fix commented warning net/http specs
    897e9b4 No need to save/restore $VERBOSE when using the complain matcher
    416ab81 2.5 no longer rescue exceptions of Integer#step to rethrow them as TypeError
    f125a5d Numeric comparison operators no longer rescue exceptions
    14bd5a4 Fix a few issues detected with $VERBOSE = true warnings
    b53aa1b internal methods are not specs
    7190a66 Remove duplicate specs
    4753368 Fix some variables which were not availble for specdocs
    bd885a6 Fix version-dependent warnings
    26d13c0 Use the argv helper in getoptlong specs
    3ba4551 Fix warnings in IO spec
    a799f55 Remove continuation specs, continuation is obsolete since 2.2
    328c7d8 Fix all warnings
    8a491a9 Fix warnings in C-API specs
    6227caa Fix remaining warnings in language specs
    729a0ec Fix a few warnings in language
    ee5b6a0 fix warning
    863c8ac Expect circular argument warnings
    eeef0e7 Fix class variable warnings in langauge specs
    ccaf342 Fix remaining warnings in core
    388adda Fix Kernel#=== spec
    1ac4d2a Expect warnings from top-level class vars
    f327217 Add expectations for argument + block warnings
    1a42389 Add expectations for Ignoring encoding parameter warnings
    dc2fd40 Fix a few more constant redefined warnings
    4756e8d Avoid 2 already initialized constant warnings
    faaf5ab Use local variables instead of constants in define_method spec
    8341bb2 Catch warning in deprecate_constant spec
    3940632 Remove unused constant
    4280c78 Use Dir.chdir directly instead of relying on ruby_exe
    4b9a0f3 Wrap a few warnings as complain matchers
    50357ca Replace deprecated Enumerator.new(obj) with obj.to_enum
    b416c79 Remove deprecated usage of $KCODE in specs
    b37650b Inline MSpec helper used only twice in the same file
    579055b Avoid be_computed_by_function
    8fea4ed Simply perform the action over using weird MSpec helpers
    735ee77 Unshare Process#spawn and Process#exec specs
    0a56f79 Avoid running #exec-related specs 3 times
    5ca04db Avoid running #spawn-related specs 3 times
    fd91fee Use the full bug version Range as AppVeyor uses an older 2.3.3 Ruby
    7b0bf1a Reintroduce bug guard as 2.4.1 is not available on Travis OS X yet
    7bbadd1 Update versions
    5bb0536 The bug has been fixed in all latest 2.x releases
    8ca440d Add spec for identity of String literals in a compare_by_identity Hash
    c6704df Opal strings are always frozen, avoid dup & clone
    556a6db Also exclude AIX from log specs as it was before
    9266dc7 Exclude Solaris from Syslog specs as it was before
    fead51e Fix platform guard
    44c0278 Simplify platform_is os: VALUE to just platform_is VALUE as they are the same now
    5a17f65 platform guard requires OS name list, not an array
    cd7e2f7 Fix platform guard in Float#round spec
    c698d12 Merge pull request #426 from ruby/removed-deprecated-mathn
    49cdead Ignored mathn examples
    27080f0 Move TTY checks inside the example
    c766f34 Remove unneeded guard
    bc9272e Remove the last not_supported_on :jruby
    f119ab6 Remove not_supported_on which can be replaced by tags
    1f72098 Remove unneeded not_supported_on guard
    f73cc7e Remove bad not_supported_on guards
    ab97f67 Remove bad not_supported_on guards
    f5764a5 Fix references to removed guards and use generic text instead
    7279501 Remove unused require
    f1e34eb Remove useless requires to mspec helpers already loaded
    39a43e9 Remove useless require
    47d5757 Inline the single usage of the home_directory helper
    c8bb8f0 Remove useless before/after in Dir.home spec
    9d8e406 Simplify expectation as it only tests on non-Windows
    1bdfcd5 Use Dir.home in File.expand_path spec
    6b1764b Just use `hostname` to get the hostname
    ce16689 Use standard File::NULL over mspec helper
    196d2bf Remove process_is_foreground guards
    a22149f Merge pull request #425 from ruby/ignored-deprecated-extensions
    5397086 Ignored mathn/{complex,rational} examples. These are deprecated from Ruby 2.5
    520200a Revert "Avoid using #fork in Process#wait specs"
    6fe19cb Add specs for Hash#dig with default
    a12d209 Require date (#423)
    cdbc5f0 String#crypt with NUL (#420)
    aee1fad Merge branch 'nobu-bug/psych-update'
    6357533 Picked YAML.load_stream example from #418
    83bbd45 Merge pull request #417 from hsbt/fixed-spec-fail-for-psych
    1a952f5 Follow psych-3.0.0.beta1
    18efd61 Ignored deprecated methods of psych-3.0.0.beta1 with Ruby 2.5.0
    a488ce5 TypedData_Get_Struct unwraps data for a parent type
    4bbfa0c Refactor httpgenericrequest/exec_spec to use an actual Net::BufferedIO
    72273d3 Remove old guards testing for Ruby < 2.2
    1a28138 Remove old 2.1 or < 2.2 guards in C-API specs
    e4763d5 Remove Logger::Application specs which no longer exist in Ruby 2.2+
    60ccbba Drop support for Ruby 2.1
    6686326 An invalid timezone has a non-zero offset on AIX
    96ba5d5 Add 2.2 guard for Etc.nprocessors, 2.1 is not yet removed from CI
    3b8d553 Add spec for Etc.nprocessors
    8fd7a69 Remove files with no specs
    2829346 rb_ary_store raises an error if array is frozen
    e1fb7b4 Fix typo
    42c1320 Add a spec for rb_ary_new_from_values
    9ba7adb Add specs for rb_ary_new_capa
    825c0a0 Add a spec for rb_struct_members
    89f4e62 Use have_constant matcher rather than #const_defined?
    320b4fb remove #sort since Struct.members guarantees the order
    ca6957b Add specs for rb_struct_define_under
    5b0d3f8 Fix typo in spec method being tested
    cb1b38e rb_struct_aset raises an error if struct is frozen
    cab4987 rb_struct_aset raises an error if index is out of range
    64f8bcc rb_struct_aref raises an error if index is out of range
    e4db1d3 Add specs for rb_struct_define
    af5412d Add specs for rb_struct_s_members
    ecc868d Update to 2.3.4
    4207e0e Symbol#hash was fixed in 2.3.4
    d6ade33 Fix inaccurate description of a spec in string_times
    4aed560 Revert "Use fixnum_max+1 to mean "not fitting into a Fixnum""
    a4e6958 Use fixnum_max+1 to mean "not fitting into a Fixnum"
    a5e707a Use fixnum_max helper
    582eed5 Share tests between String#* and rb_str_times
    fa4e6b2 Add specs for rb_str_times
    9c73e8b Specs for three initial vulnerabilities
    25aa763 Add a spec for rb_String (#395)
    0adc519 Add specs for rb_ary_rotate
    03e3fba Add specs for rb_ary_cat
    9078f37 Add a spec for rb_Hash
    7847fa8 Update ruby_bug guards
    
    git-subtree-dir: spec/ruby
    git-subtree-split: 0db663be26db58348eb1cf2b2c4af6a2eca005f4
    eregon committed Apr 28, 2017
    Copy the full SHA
    4991312 View commit details
  4. Copy the full SHA
    7e0e5c2 View commit details
  5. Add tags for new specs

    eregon committed Apr 28, 2017
    Copy the full SHA
    6224865 View commit details
Showing 392 changed files with 4,632 additions and 6,772 deletions.
6 changes: 2 additions & 4 deletions spec/mspec/.travis.yml
Original file line number Diff line number Diff line change
@@ -3,9 +3,7 @@ language: ruby
script:
- bundle exec rspec
rvm:
- 2.0.0
- 2.1.10
- 2.2.6
- 2.3.3
- 2.2.7
- 2.3.4
- 2.4.1
- ruby-head
3 changes: 1 addition & 2 deletions spec/mspec/lib/mspec/commands/mkspec.rb
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ def write_version(f)

def write_spec(file, meth, exists)
if exists
out = `#{ruby} #{MSPEC_HOME}/bin/mspec-run --dry-run -fs -e '#{meth}' #{file}`
out = `#{ruby} #{MSPEC_HOME}/bin/mspec-run --dry-run --unguarded -fs -e '#{meth}' #{file}`
return if out.include?(meth)
end

@@ -153,4 +153,3 @@ def self.main
script.run
end
end

1 change: 0 additions & 1 deletion spec/mspec/lib/mspec/commands/mspec-ci.rb
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ def options(argv=ARGV)
options.configure { |f| load f }
options.name
options.pretend
options.background
options.interrupt

options.doc "\n How to modify the guard behavior"
1 change: 0 additions & 1 deletion spec/mspec/lib/mspec/commands/mspec-run.rb
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@ def options(argv=ARGV)
options.randomize
options.repeat
options.pretend
options.background
options.interrupt

options.doc "\n How to modify the guard behavior"
16 changes: 11 additions & 5 deletions spec/mspec/lib/mspec/commands/mspec.rb
100644 → 100755
Original file line number Diff line number Diff line change
@@ -10,7 +10,9 @@

class MSpecMain < MSpecScript
def initialize
config[:includes] = []
super

config[:loadpath] = []
config[:requires] = []
config[:target] = ENV['RUBY'] || 'ruby'
config[:flags] = []
@@ -94,7 +96,8 @@ def multi_exec(argv)
formatter = MultiFormatter.new

output_files = []
children = cores.times.map { |i|
processes = [cores, @files.size].min
children = processes.times.map { |i|
name = tmp "mspec-multi-#{i}"
output_files << name

@@ -128,30 +131,33 @@ def multi_exec(argv)
}
end

ok = true
children.each { |child|
child.puts "QUIT"
Process.wait(child.pid)
ok &&= $?.success?
}

formatter.aggregate_results(output_files)
formatter.finish
ok
end

def run
argv = config[:target].split(/\s+/)

argv.concat config[:launch]
argv.concat config[:flags]
argv.concat config[:includes]
argv.concat config[:loadpath]
argv.concat config[:requires]
argv << "#{MSPEC_HOME}/bin/mspec-#{ config[:command] || "run" }"
argv.concat config[:options]

if config[:multi]
multi_exec argv
exit multi_exec(argv)
else
$stderr.puts "$ #{argv.join(' ')}"
exec *argv
exec(*argv)
end
end
end
4 changes: 2 additions & 2 deletions spec/mspec/lib/mspec/expectations/expectations.rb
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@ def self.fail_with(expected, actual)
expected_to_s = expected.to_s
actual_to_s = actual.to_s
if expected_to_s.size + actual_to_s.size > 80
message = expected_to_s.chomp + "\n" + actual_to_s
message = "#{expected_to_s.chomp}\n#{actual_to_s}"
else
message = expected_to_s + " " + actual_to_s
message = "#{expected_to_s} #{actual_to_s}"
end
Kernel.raise SpecExpectationNotMetError, message
end
8 changes: 0 additions & 8 deletions spec/mspec/lib/mspec/guards.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
require 'mspec/utils/ruby_name'
require 'mspec/guards/background'
require 'mspec/guards/block_device'
require 'mspec/guards/bug'
require 'mspec/guards/compliance'
require 'mspec/guards/conflict'
require 'mspec/guards/endian'
require 'mspec/guards/extensions'
require 'mspec/guards/feature'
require 'mspec/guards/guard'
require 'mspec/guards/noncompliance'
require 'mspec/guards/platform'
require 'mspec/guards/quarantine'
require 'mspec/guards/runner'
require 'mspec/guards/specified'
require 'mspec/guards/support'
require 'mspec/guards/superuser'
require 'mspec/guards/tty'
require 'mspec/guards/user'
require 'mspec/guards/version'
21 changes: 0 additions & 21 deletions spec/mspec/lib/mspec/guards/background.rb

This file was deleted.

8 changes: 2 additions & 6 deletions spec/mspec/lib/mspec/guards/block_device.rb
Original file line number Diff line number Diff line change
@@ -12,11 +12,7 @@ def match?
end

class Object
def with_block_device
g = BlockDeviceGuard.new
g.name = :with_block_device
yield if g.yield?
ensure
g.unregister
def with_block_device(&block)
BlockDeviceGuard.new.run_if(:with_block_device, &block)
end
end
24 changes: 15 additions & 9 deletions spec/mspec/lib/mspec/guards/bug.rb
Original file line number Diff line number Diff line change
@@ -3,22 +3,28 @@
class BugGuard < VersionGuard
def initialize(bug, version)
@bug = bug
@version = SpecVersion.new version, true
self.parameters = [@bug, @version]
if String === version
MSpec.deprecate "ruby_bug with a single version", 'an exclusive range ("2.1"..."2.3")'
@version = SpecVersion.new version, true
else
super(version)
end
@parameters = [@bug, @version]
end

def match?
return false if MSpec.mode? :no_ruby_bug
standard? && ruby_version <= @version
return false unless PlatformGuard.standard?
if Range === @version
super
else
FULL_RUBY_VERSION <= @version
end
end
end

class Object
def ruby_bug(bug, version)
g = BugGuard.new bug, version
g.name = :ruby_bug
yield if g.yield? true
ensure
g.unregister
def ruby_bug(bug, version, &block)
BugGuard.new(bug, version).run_unless(:ruby_bug, &block)
end
end
37 changes: 0 additions & 37 deletions spec/mspec/lib/mspec/guards/compliance.rb

This file was deleted.

10 changes: 3 additions & 7 deletions spec/mspec/lib/mspec/guards/conflict.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ class ConflictsGuard < SpecGuard
def match?
# Always convert constants to symbols regardless of version.
constants = Object.constants.map { |x| x.to_sym }
@args.any? { |mod| constants.include? mod }
@parameters.any? { |mod| constants.include? mod }
end
end

@@ -13,11 +13,7 @@ class Object
# behavior. The specs for the method's behavior will then fail
# if that library is loaded. This guard will not run if any of
# the specified constants exist in Object.constants.
def conflicts_with(*modules)
g = ConflictsGuard.new(*modules)
g.name = :conflicts_with
yield if g.yield? true
ensure
g.unregister
def conflicts_with(*modules, &block)
ConflictsGuard.new(*modules).run_unless(:conflicts_with, &block)
end
end
22 changes: 4 additions & 18 deletions spec/mspec/lib/mspec/guards/endian.rb
Original file line number Diff line number Diff line change
@@ -16,26 +16,12 @@ def match?
end
end

class LittleEndianGuard < EndianGuard
def match?
pattern[-1] == ?\000
end
end

class Object
def big_endian
g = BigEndianGuard.new
g.name = :big_endian
yield if g.yield?
ensure
g.unregister
def big_endian(&block)
BigEndianGuard.new.run_if(:big_endian, &block)
end

def little_endian
g = LittleEndianGuard.new
g.name = :little_endian
yield if g.yield?
ensure
g.unregister
def little_endian(&block)
BigEndianGuard.new.run_unless(:little_endian, &block)
end
end
22 changes: 0 additions & 22 deletions spec/mspec/lib/mspec/guards/extensions.rb

This file was deleted.

8 changes: 2 additions & 6 deletions spec/mspec/lib/mspec/guards/feature.rb
Original file line number Diff line number Diff line change
@@ -37,11 +37,7 @@ class Object
#
# MSpec.enable_feature :encoding
#
def with_feature(*features)
g = FeatureGuard.new(*features)
g.name = :with_feature
yield if g.yield?
ensure
g.unregister
def with_feature(*features, &block)
FeatureGuard.new(*features).run_if(:with_feature, &block)
end
end
Loading