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: 04c3cf4313ed
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 43efdb03b54f
Choose a head ref
  • 4 commits
  • 237 files changed
  • 1 contributor

Commits on Oct 28, 2017

  1. Squashed 'spec/mspec/' changes from 8aa352c..90925d6

    90925d6 Make sure $stderr is flushed before exec()
    5bfe0e4 Fix Mock.verify_call to mock_respond_to?
    d3d65b4 Merge pull request #34 from mjago/master
    4fab2e9 Update travis versions.
    3c377af Fix misspell with https://github.com/client9/misspell
    2fdb150 Prefer ruby_version_is over RUBY_VERSION String comparisons in MSpec itself
    b6065fe Ignore no warnings in while in the complain matcher
    24b9300 Restore $stderr/VERBOSE as quickly as possible in #complain
    ffaf1c3 Capture once the output in #complain instead of going saving the IOStub
    3574737 Save state before modifying it
    dc87d31 Try to detect missing .should with warnings about possibly useless <|<=|==|>=|>
    4a7d181 Update to TruffleRuby 0.28 in Travis
    a96f0f3 Use better variable names in MSpecScript#files
    ab7e7cd Make sure we have files to run at the end of files_from_patterns
    a6a6c95 Abort if a non-existing config key is passed
    
    git-subtree-dir: spec/mspec
    git-subtree-split: 90925d6672a7cf1cc468fb5b23bcb62453c0491e
    eregon committed Oct 28, 2017
    Copy the full SHA
    aeb1737 View commit details
  2. Copy the full SHA
    009de4e View commit details
  3. Squashed 'spec/ruby/' changes from 691755d..a6b8805

    a6b8805 Fix the 2.5 example of Warning.warn to be independent of $VERBOSE
    65f80f6 Make the Warning.warn specs work indepent of the external warning level
    9daa40d Fix for loop for old before C99 compilers
    b25e9ec Add a couple more expectations for post + kwargs
    ea6c301 Fix style
    f04a632 Improve warnings when there are leaked process before the Process.wait2 specs
    e186683 Add an example for readlink with unicode characters
    43adad3 Add spec for a binary Symbol
    aa792e7 Add rb_str_new example with offset
    e6b67cd Add spec verifying $VERBOSE allows truthy values.
    61e7f32 Add rb_yield passing block with each spec
    3e945e7 Recompile spec cexts if the ruby library changed
    f398b2c Improve SafeStringValue by sharing the specs of StringValue
    1bbcba9 Fix SafeStringValue, add spec
    be895f7 Test rb_class_of() with an object with a singleton class
    b2e08d2 Use stub! when there is no guarantee if and how many times it is called
    4125eca Add specs for [Feature#13983] Rational and Complex should be frozen
    6b6d33e Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature#13873]"
    6019e87 io.c: write a newline together
    4c42133 Dir.glob with FNM_EXTGLOB is optimized [Feature#13873]
    07576e1 Revert "ignore server side error"
    00a6585 ignore server side error
    ad5eb0a spec/ruby/optional/capi/io_spec.rb: speling fics
    e79f3eb array.c: improve operations on small arrays
    340826a Use #gets instead of recv(2014) for FTP specs
    bc5521a Avoid warnings in if with multiple assignments
    8916cca Fix ruby_bug version range and expectation
    061ac41 Make it clear top-level return specs specify the ruby 2.4.2 behavior
    9a26eda Clarify how to use ruby_bug
    6078bba Add specs for Integer.sqrt [Feature #13219]
    45e578a Add more specs for Date#next_month, Date#prev_month
    fb5a97b Improve specs for Date#next_day, Date#prev_day
    d9c1c83 Code review. Mark some test cases as bugs
    63b3d78 Code review. Replace excessive `ruby_exe` calls with temp file loading
    04fd5be Add specs for top-level return (tested with Ruby 2.4.2)
    847d901 spec for regexp absent operator
    6ea9b6b Rename file to match standard naming conventions
    9cfced0 Fix a couple spec descriptions
    53dc62f Add spec for REXML::Element#[]
    81c9b4f Remove unnecessary top-level version guard in Module#refine specs
    ab3765e Add specs for Module#using
    7cf3b1d Update specs for main#using
    37a2e86 Add specs for Module#refine for Ruby 2.4
    dca2e4f Add specs for Module#refine
    214743d Update specs for Module#refine
    44a1368 Restore specs for main#using (45fe77547a063284cbc04faf6708a426ed68f712)
    84c940e Restore specs for Module#refine (45fe77547a063284cbc04faf6708a426ed68f712)
    58154a0 Fix misspell with https://github.com/client9/misspell
    21f7385 Use multiple lines in StringIO chomp: true examples
    b6ed5bf Changed incorrect carriage return usage to newline characters
    74190bb Add chomp specs for StringIO#gets, StringIO#readline, StringIO#each_line, StringIO#readlines, StringIO#each and StringIO#lines
    863f342 Changed incorrect carriage return usage to newline characters
    e8f16ca Add chomp specs for IO#gets, IO#readline, IO#each_line, IO#readlines and IO.foreach
    9457cc8 close logger
    93a2219 test shift_period_suffix
    92a38a8 Code review. Update case descriptions
    c135a65 Add spec for CSV#readlines to test parsing illegal input
    d98f29b Add spec for CSV.parse to test parsing illegal input
    d3dc4b8 Add specs for CSV#liberal_parsing?
    5be6e46 DateTime.now uses be_close to avoid day rollover
    9c73504 Properly implement be_close on timing assertion
    8258707 Be close enough on time
    d691fbd Replace data shell out with Process#clock_gettime
    44bd7e6 Better describes the Timezone preservation for DateTime.now
    fa464db Time.now preserves local timezone
    fc8dad7 Date.today checks against local date
    0ac7b33 Time.now spec checks time
    a2d4732 Expands coverage of DateTime#now
    feef77e Adds DateTime#to_s
    dae126d Adds DateTime#to_date
    d62a273 Adds DateTime#to_datetime
    f48b4a4 add spec for ConditionVariable#marshal_dump
    3516c4a Update RuboCop to 0.51.0
    92e2231 Remove spec, a better one is coming in PR 528
    9dc9897 test instantiating logger with keyword arguments
    441b94b Recommend to not use should_not raise_error
    b006666 fix a couple typos
    3ce41f7 Add spec for OptionParser#parse into argument
    da9f1eb Add spec for OptionParser#order into argument
    213041c Avoid printing the return value of Warning.warn/IO#puts
    8d35f67 Move parser warnings to 2.4
    da55149 Add spec for overriding Warning.warn
    ebcdd4c Add a few more specs to Warning.warn
    f7da018 Add spec for Warning.warn
    4ca0dd0 Code review. Fix spec description
    3b46c0c Add spec for Shelwords.shelwords bug with backslash escaping
    76d9649 try to clarify when to use ruby_bug
    0f1c23e Add spec for `IPAddr#==` bug
    2602cd8 Add specs for Net::HTTP.post
    f6a1941 Refactoring spec for Date#wday
    cb0fd00 Add spec for Date#friday?
    d72d05d Add Date#saturday? spec
    e84fba1 Add Date#friday? spec
    0b6d255 Add Date#thursday? spec
    0cda9f2 Add Date#wednesday? spec
    134361c Add Date#tuesday? spec
    eebb66f Add Date#monday? spec
    36ebba9 Add Date#sunday? spec
    0f78774 Add Date#wday spec
    e78f0ba transform_values: add spec for partial modification
    fa11325 transform_values: test for empty frozen hash
    fb65f5a Add spec for Hash#transform_values
    7e4033a remove extra proc, clean up desc
    08d6e68 use scratchpad for mult. assign test
    149faaf catch error to get other ruby versions passing
    6e55b81 Add spec for multiple assignment conditional
    5c705c1 Merge pull request #522 from 284km/fix-typo
    75129db Fix a typo
    559bc18 Enable Thread.report_on_exception = true by default in ruby/spec
    5ea6848 Add specs for Thread{.,#}report_on_exception{=,}
    66a6754 Mark behavior with the reported upstream bug
    d33bc13 Code review. Check both "\n" and "\r\n"
    0a1ac1a Add specs for `chomp` argument of `String#lines` and `String#each_line`
    a8d352e Ensure that Ruby 2.4 supports rescue in method arguments #473
    d4892bd Add specs for \X character class
    8c1b3f5 Add a list of common guards
    b54e8c6 Add a list of frequently-used matchers to get started
    a0ae256 enable the leak checker on macOS since we get EBADF errors
    14a951a Improve descriptions
    4854304 add missing :
    b59a9ca changed assertion language and used symbol literals
    6f4f946 added missing do after assertion
    d4e2148 Character manipulation coverage for symbol ruby 2.4
    5a0f22a Code review. Check string content instead of not raising exception
    e873562 Add simple test for `capacity` argument of `String.new` method
    77f23fa Core review. Add case with long buffer and use `equal`
    35307dd Add specs for `Array#pack`'s `buffer` option
    9e81f33 Add specs for TracePoint#callee_id
    0ba04d7 Add Set#compare_by_identity & Set#compare_by_identity? specs
    fa456b4 Add specs for Set#compare_by_identity
    6345a38 Add a spec for deprecation warnings on Fixnum/Bignum
    e3b13f1 Add missing version guard and improve description
    9027d74 Code review. Replace `==` with `equal` and add spec for `Integer`
    7626b75 Update Fixnum specs
    b894db3 Update Bignum specs
    25883f4 spec: covered String#upcase!
    0e937c3 spec: covered String#swapcase!
    7e97cb8 spec: covered String#downcase!
    199a0b7 spec: covered String#capitalize!
    ae5fc98 Fix style of a couple specs breaking lines when not needed
    ba295cb Add missing should in Array#permutation spec
    d245974 Check the return value of & to avoid warnings
    2144b2a Merge pull request #500 from joshgelbard/more-missing-should
    0d5a424 Add more missing .should calls
    770b3bf Improve specs description
    0f3e461 Add specs for `half` option in `Rational#round`
    3e43ae5 Add missing ".should" and fix subsequent failure
    38b085c Add a spec testing what calls are made for Array#sum
    e3e3ffa Code review. Implement test case without refinements
    232dcc7 Add specs for Array#sum
    a68c5e9 Spec Constant ||= for all scoping possibilities.
    f5146f1 Make sure the returned time is the same instance
    c4cdc6b Moves the to_time call into the with_timezone to verify no timezone shift
    50bf0a9 Version guard on timezone preservation of DateTime#to_time
    d8bb344 Updates for clarity on to_time
    dd6fbc0 Adds timezone comparison
    04cbc22 Adds specs for DateTime#to_time
    a538fa9 Time#to_time spec
    f8a9f7c Fix some typos in test descriptions
    1915741 Adds specs for Complex with infinity on the real part
    43df951 Adds Complex#finite? and Complex#infinite?
    e2a9b65 Add Numeric#finite? and Numeric#infinite?
    0a2d315 Supplement specs for Enumerable#uniq
    fa47230 Add spec for complex expression in ().
    ef70ce7 Adds String#unpack1 (#488)
    6d04a08 Skip failing spec on Travis CI due to the special Travis environment
    de02faa Update to latest MRI releases
    487a79d Enable the TrailingWhitespace cop
    1af928f Update to RuboCop 0.50
    ec7a116 Add spec for CGI::Cookie.parse about handling , separator
    64c06f9 Fix integer rounding-related specs for the new behavior on 2.5
    75b1a1f Add more specs for Integer#ceil and Integer#floor
    100bec0 Add specs for Integer#truncate that takes optional digits
    8d097ed Add specs for Integer#floor that takes optional digits
    c0f73bd Add specs for Integer#ceil that takes optional digits
    dea4eb7 Changes on Pathname#empty? specs per Peer-Review
    d19fcad Adding Pathname#empty? specs
    819a4e4 Clarifies Integer#digits radix mechanics
    d59065a Adds specs for Integer#digits
    04add34 Removes dependence on DirSpecs fixtures
    9d8e136 Nitpick: it's Dir.empty?, not Dir#empty?
    36a81ce Adds specs for Dir#empty?
    bd9eda1 Add specs for symbol#casecmp? (#480)
    7904658 Add spec for Integer#round(half:)
    8501780 Symbol with invalid bytes are detected at parse time
    3d5efd7 Symbol are unique so also test their identity with #equal?
    1ff0e0a Improve String#to_sym spec to specify the encoding of the resulting Symbol
    8f96e83 Use UTF-8 characters instead of escape sequences when possible
    6f182f9 Move to utf-8 encoding in the Symbol#casecmp spec
    c33c429 Improve String#casecmp? spec and use String literals when possible
    f4ade8d spec for String#casecmp?
    88036c3 Add spec for Net::FTP#status(pathname)
    2429bba Add spec for Float#round(half:)
    6bf1725 Add spec for File.empty?
    2c43fec Adds specs for Float#ceil, Float#floor, and Float#truncate (#475)
    c073cd3 Fix whitespace [ci-skip]
    1153e30 Tweak spec so it doesn't assume that number literals are always the same object.
    6e943e1 Fix whitespace [ci-skip]
    f07c3de Spec that Array#min,max are defined and not just from Enumerable
    a6c4f6e Fix of MRI Bug 12367 was backported to 2.3 and 2.2
    24515bc add specs for 2.4+ MRI behavior on duping numerics,nil,false and true
    e778d17 Create objects in before blocks in super specs
    61db431 improved specs for super arguments
    
    git-subtree-dir: spec/ruby
    git-subtree-split: a6b8805fe3fe9cea81bbcebffb8a0fac5b09dbc2
    eregon committed Oct 28, 2017
    Copy the full SHA
    c5a12a9 View commit details
  4. Copy the full SHA
    43efdb0 View commit details
Showing with 4,228 additions and 410 deletions.
  1. +4 −4 spec/mspec/.travis.yml
  2. +2 −1 spec/mspec/lib/mspec/commands/mspec.rb
  3. +19 −15 spec/mspec/lib/mspec/matchers/complain.rb
  4. +1 −1 spec/mspec/lib/mspec/mocks/mock.rb
  5. +1 −1 spec/mspec/lib/mspec/runner/context.rb
  6. +18 −16 spec/mspec/lib/mspec/utils/script.rb
  7. +12 −2 spec/mspec/lib/mspec/utils/warnings.rb
  8. +2 −9 spec/mspec/spec/commands/mspec_run_spec.rb
  9. +3 −3 spec/mspec/spec/mocks/mock_spec.rb
  10. +4 −4 spec/mspec/spec/runner/filters/profile_spec.rb
  11. +5 −4 spec/mspec/spec/utils/script_spec.rb
  12. +20 −1 spec/ruby/.rubocop.yml
  13. +6 −7 spec/ruby/.rubocop_todo.yml
  14. +8 −6 spec/ruby/.travis.yml
  15. +107 −0 spec/ruby/CONTRIBUTING.md
  16. +2 −2 spec/ruby/core/array/at_spec.rb
  17. +7 −6 spec/ruby/core/array/intersection_spec.rb
  18. +6 −0 spec/ruby/core/array/max_spec.rb
  19. +6 −0 spec/ruby/core/array/min_spec.rb
  20. +5 −5 spec/ruby/core/array/minus_spec.rb
  21. +52 −0 spec/ruby/core/array/pack/buffer_spec.rb
  22. +1 −1 spec/ruby/core/array/permutation_spec.rb
  23. +1 −1 spec/ruby/core/array/pop_spec.rb
  24. +1 −1 spec/ruby/core/array/shift_spec.rb
  25. +44 −0 spec/ruby/core/array/sum_spec.rb
  26. +5 −5 spec/ruby/core/array/union_spec.rb
  27. +12 −0 spec/ruby/core/bignum/bignum_spec.rb
  28. +36 −0 spec/ruby/core/complex/finite_spec.rb
  29. +34 −0 spec/ruby/core/complex/infinite_spec.rb
  30. +33 −0 spec/ruby/core/dir/empty_spec.rb
  31. +1 −1 spec/ruby/core/dir/glob_spec.rb
  32. +1 −1 spec/ruby/core/encoding/converter/primitive_convert_spec.rb
  33. +2 −4 spec/ruby/core/encoding/converter/primitive_errinfo_spec.rb
  34. +1 −2 spec/ruby/core/encoding/converter/putback_spec.rb
  35. +1 −1 spec/ruby/core/encoding/invalid_byte_sequence_error/source_encoding_name_spec.rb
  36. +1 −1 spec/ruby/core/encoding/invalid_byte_sequence_error/source_encoding_spec.rb
  37. +1 −1 spec/ruby/core/encoding/undefined_conversion_error/source_encoding_name_spec.rb
  38. +1 −1 spec/ruby/core/encoding/undefined_conversion_error/source_encoding_spec.rb
  39. +4 −4 spec/ruby/core/enumerable/any_spec.rb
  40. +1 −1 spec/ruby/core/enumerable/cycle_spec.rb
  41. +1 −1 spec/ruby/core/enumerable/drop_spec.rb
  42. +65 −0 spec/ruby/core/enumerable/uniq_spec.rb
  43. +1 −1 spec/ruby/core/enumerator/lazy/force_spec.rb
  44. +9 −0 spec/ruby/core/false/dup_spec.rb
  45. +15 −0 spec/ruby/core/file/empty_spec.rb
  46. +21 −2 spec/ruby/core/file/readlink_spec.rb
  47. +5 −5 spec/ruby/core/file/shared/fnmatch.rb
  48. +12 −0 spec/ruby/core/fixnum/fixnum_spec.rb
  49. +10 −0 spec/ruby/core/float/ceil_spec.rb
  50. +10 −0 spec/ruby/core/float/dup_spec.rb
  51. +10 −0 spec/ruby/core/float/floor_spec.rb
  52. +14 −0 spec/ruby/core/float/round_spec.rb
  53. +10 −0 spec/ruby/core/float/truncate_spec.rb
  54. +2 −2 spec/ruby/core/hash/delete_spec.rb
  55. +21 −0 spec/ruby/core/hash/transform_values_spec.rb
  56. +15 −0 spec/ruby/core/integer/ceil_spec.rb
  57. +34 −0 spec/ruby/core/integer/digits_spec.rb
  58. +10 −0 spec/ruby/core/integer/dup_spec.rb
  59. +15 −0 spec/ruby/core/integer/floor_spec.rb
  60. +7 −0 spec/ruby/core/integer/integer_spec.rb
  61. +33 −15 spec/ruby/core/integer/round_spec.rb
  62. +31 −0 spec/ruby/core/integer/shared/integer_rounding.rb
  63. +33 −0 spec/ruby/core/integer/sqrt_spec.rb
  64. +15 −0 spec/ruby/core/integer/truncate_spec.rb
  65. +1 −1 spec/ruby/core/io/advise_spec.rb
  66. +12 −0 spec/ruby/core/io/fixtures/classes.rb
  67. +9 −1 spec/ruby/core/io/gets_spec.rb
  68. +3 −6 spec/ruby/core/io/puts_spec.rb
  69. +8 −0 spec/ruby/core/io/readline_spec.rb
  70. +9 −0 spec/ruby/core/io/shared/each.rb
  71. +7 −0 spec/ruby/core/io/shared/readlines.rb
  72. +3 −3 spec/ruby/core/kernel/equal_value_spec.rb
  73. +18 −0 spec/ruby/core/kernel/freeze_spec.rb
  74. +26 −0 spec/ruby/core/kernel/frozen_spec.rb
  75. +24 −0 spec/ruby/core/kernel/shared/dup_clone.rb
  76. +3 −0 spec/ruby/core/main/fixtures/classes.rb
  77. +7 −0 spec/ruby/core/main/fixtures/string_refinement.rb
  78. +11 −0 spec/ruby/core/main/fixtures/string_refinement_user.rb
  79. +134 −0 spec/ruby/core/main/using_spec.rb
  80. +2 −2 spec/ruby/core/module/const_defined_spec.rb
  81. +13 −0 spec/ruby/core/module/fixtures/refine.rb
  82. +10 −0 spec/ruby/core/module/fixtures/using.rb
  83. +616 −0 spec/ruby/core/module/refine_spec.rb
  84. +276 −0 spec/ruby/core/module/using_spec.rb
  85. +3 −8 spec/ruby/core/mutex/lock_spec.rb
  86. +9 −0 spec/ruby/core/nil/dup_spec.rb
  87. +1 −1 spec/ruby/core/numeric/coerce_spec.rb
  88. +10 −0 spec/ruby/core/numeric/finite_spec.rb
  89. +10 −0 spec/ruby/core/numeric/infinite_spec.rb
  90. +4 −1 spec/ruby/core/process/wait2_spec.rb
  91. +2 −2 spec/ruby/core/random/bytes_spec.rb
  92. +8 −0 spec/ruby/core/string/capitalize_spec.rb
  93. +69 −5 spec/ruby/core/string/casecmp_spec.rb
  94. +8 −0 spec/ruby/core/string/downcase_spec.rb
  95. +9 −0 spec/ruby/core/string/lines_spec.rb
  96. +7 −0 spec/ruby/core/string/new_spec.rb
  97. +2 −4 spec/ruby/core/string/shared/chars.rb
  98. +1 −1 spec/ruby/core/string/shared/codepoints.rb
  99. +14 −0 spec/ruby/core/string/shared/each_line.rb
  100. +53 −14 spec/ruby/core/string/shared/to_sym.rb
  101. +8 −0 spec/ruby/core/string/swapcase_spec.rb
  102. +12 −0 spec/ruby/core/string/unpack1_spec.rb
  103. +9 −0 spec/ruby/core/string/upcase_spec.rb
  104. +1 −1 spec/ruby/core/struct/initialize_spec.rb
  105. +7 −0 spec/ruby/core/symbol/capitalize_spec.rb
  106. +89 −17 spec/ruby/core/symbol/casecmp_spec.rb
  107. +7 −0 spec/ruby/core/symbol/downcase_spec.rb
  108. +9 −0 spec/ruby/core/symbol/dup_spec.rb
  109. +7 −0 spec/ruby/core/symbol/swapcase_spec.rb
  110. +7 −0 spec/ruby/core/symbol/upcase_spec.rb
  111. +4 −4 spec/ruby/core/thread/element_set_spec.rb
  112. +6 −1 spec/ruby/core/thread/fixtures/classes.rb
  113. +4 −1 spec/ruby/core/thread/join_spec.rb
  114. +1 −1 spec/ruby/core/thread/key_spec.rb
  115. +6 −0 spec/ruby/core/thread/raise_spec.rb
  116. +102 −0 spec/ruby/core/thread/report_on_exception_spec.rb
  117. +1 −1 spec/ruby/core/thread/shared/exit.rb
  118. +4 −1 spec/ruby/core/thread/value_spec.rb
  119. +12 −0 spec/ruby/core/time/shared/now.rb
  120. +2 −4 spec/ruby/core/time/shared/time_params.rb
  121. +20 −0 spec/ruby/core/tracepoint/callee_id_spec.rb
  122. +8 −0 spec/ruby/core/tracepoint/fixtures/classes.rb
  123. +9 −0 spec/ruby/core/true/dup_spec.rb
  124. +60 −0 spec/ruby/core/warning/warn_spec.rb
  125. +1 −1 spec/ruby/language/README
  126. +1 −1 spec/ruby/language/block_spec.rb
  127. +6 −7 spec/ruby/language/break_spec.rb
  128. +7 −0 spec/ruby/language/case_spec.rb
  129. +10 −12 spec/ruby/language/class_spec.rb
  130. +14 −3 spec/ruby/language/constants_spec.rb
  131. +1 −1 spec/ruby/language/defined_spec.rb
  132. +2 −2 spec/ruby/language/ensure_spec.rb
  133. +4 −0 spec/ruby/language/fixtures/binary_symbol.rb
  134. +114 −19 spec/ruby/language/fixtures/super.rb
  135. +19 −0 spec/ruby/language/if_spec.rb
  136. +8 −2 spec/ruby/language/method_spec.rb
  137. +2 −2 spec/ruby/language/optional_assignments_spec.rb
  138. +19 −0 spec/ruby/language/predefined_spec.rb
  139. +23 −0 spec/ruby/language/regexp/character_classes_spec.rb
  140. +7 −0 spec/ruby/language/regexp/modifiers_spec.rb
  141. +7 −0 spec/ruby/language/rescue_spec.rb
  142. +222 −1 spec/ruby/language/return_spec.rb
  143. +98 −21 spec/ruby/language/super_spec.rb
  144. +13 −0 spec/ruby/language/symbol_spec.rb
  145. +8 −7 spec/ruby/language/throw_spec.rb
  146. +1 −1 spec/ruby/library/bigdecimal/sign_spec.rb
  147. +21 −0 spec/ruby/library/cgi/cookie/parse_spec.rb
  148. +3 −3 spec/ruby/library/cgi/shared/http_header.rb
  149. +9 −0 spec/ruby/library/conditionvariable/marshal_dump_spec.rb
  150. +21 −0 spec/ruby/library/csv/liberal_parsing_spec.rb
  151. +14 −0 spec/ruby/library/csv/parse_spec.rb
  152. +14 −0 spec/ruby/library/csv/readlines_spec.rb
  153. +12 −0 spec/ruby/library/date/friday_spec.rb
  154. +1 −1 spec/ruby/library/date/minus_month_spec.rb
  155. +2 −2 spec/ruby/library/date/minus_spec.rb
  156. +8 −0 spec/ruby/library/date/monday_spec.rb
  157. +7 −3 spec/ruby/library/date/next_day_spec.rb
  158. +15 −0 spec/ruby/library/date/next_month_spec.rb
  159. +3 −3 spec/ruby/library/date/prev_day_spec.rb
  160. +15 −0 spec/ruby/library/date/prev_month_spec.rb
  161. +8 −0 spec/ruby/library/date/saturday_spec.rb
  162. +8 −0 spec/ruby/library/date/sunday_spec.rb
  163. +8 −0 spec/ruby/library/date/thursday_spec.rb
  164. +9 −1 spec/ruby/library/date/today_spec.rb
  165. +8 −0 spec/ruby/library/date/tuesday_spec.rb
  166. +4 −1 spec/ruby/library/date/wday_spec.rb
  167. +8 −0 spec/ruby/library/date/wednesday_spec.rb
  168. +1 −1 spec/ruby/library/datetime/new_spec.rb
  169. +17 −0 spec/ruby/library/datetime/now_spec.rb
  170. +32 −1 spec/ruby/library/datetime/to_date_spec.rb
  171. +4 −1 spec/ruby/library/datetime/to_datetime_spec.rb
  172. +12 −1 spec/ruby/library/datetime/to_s_spec.rb
  173. +21 −1 spec/ruby/library/datetime/to_time_spec.rb
  174. +9 −3 spec/ruby/library/etc/getlogin_spec.rb
  175. +1 −1 spec/ruby/library/fiber/resume_spec.rb
  176. +1 −1 spec/ruby/library/fiber/transfer_spec.rb
  177. +1 −1 spec/ruby/library/getoptlong/terminate_spec.rb
  178. +8 −1 spec/ruby/library/ipaddr/operator_spec.rb
  179. +57 −0 spec/ruby/library/logger/logger/new_spec.rb
  180. +2 −2 spec/ruby/library/matrix/diagonal_spec.rb
  181. +3 −3 spec/ruby/library/matrix/hermitian_spec.rb
  182. +2 −2 spec/ruby/library/matrix/normal_spec.rb
  183. +2 −2 spec/ruby/library/matrix/orthogonal_spec.rb
  184. +2 −2 spec/ruby/library/matrix/permutation_spec.rb
  185. +3 −3 spec/ruby/library/matrix/symmetric_spec.rb
  186. +2 −2 spec/ruby/library/matrix/unitary_spec.rb
  187. +7 −3 spec/ruby/library/net/ftp/fixtures/server.rb
  188. +6 −0 spec/ruby/library/net/ftp/status_spec.rb
  189. +12 −0 spec/ruby/library/net/http/http/fixtures/http_server.rb
  190. +39 −0 spec/ruby/library/net/http/http/post_spec.rb
  191. +14 −14 spec/ruby/library/net/http/http/request_types_spec.rb
  192. +1 −1 spec/ruby/library/net/http/httpheader/content_length_spec.rb
  193. +32 −0 spec/ruby/library/optionparser/order_spec.rb
  194. +32 −0 spec/ruby/library/optionparser/parse_spec.rb
  195. +34 −0 spec/ruby/library/pathname/empty_spec.rb
  196. +1 −1 spec/ruby/library/pathname/relative_path_from_spec.rb
  197. +1 −1 spec/ruby/library/rexml/element/add_attributes_spec.rb
  198. +1 −1 spec/ruby/library/rexml/element/add_text_spec.rb
  199. +22 −0 spec/ruby/library/rexml/element/element_reference_spec.rb
  200. +1 −1 spec/ruby/library/securerandom/base64_spec.rb
  201. +1 −1 spec/ruby/library/securerandom/hex_spec.rb
  202. +147 −0 spec/ruby/library/set/compare_by_identity_spec.rb
  203. +1 −1 spec/ruby/library/set/shared/difference.rb
  204. +1 −1 spec/ruby/library/set/sortedset/shared/difference.rb
  205. +7 −0 spec/ruby/library/shellwords/shellwords_spec.rb
  206. +7 −6 spec/ruby/library/socket/tcpserver/accept_spec.rb
  207. +1 −1 spec/ruby/library/socket/tcpserver/new_spec.rb
  208. +6 −6 spec/ruby/library/socket/unixserver/accept_spec.rb
  209. +6 −0 spec/ruby/library/stringio/each_line_spec.rb
  210. +6 −0 spec/ruby/library/stringio/each_spec.rb
  211. +1 −1 spec/ruby/library/stringio/getc_spec.rb
  212. +1 −1 spec/ruby/library/stringio/getch_spec.rb
  213. +11 −2 spec/ruby/library/stringio/gets_spec.rb
  214. +6 −0 spec/ruby/library/stringio/lines_spec.rb
  215. +11 −2 spec/ruby/library/stringio/readline_spec.rb
  216. +9 −0 spec/ruby/library/stringio/readlines_spec.rb
  217. +9 −0 spec/ruby/library/stringio/shared/each.rb
  218. +17 −0 spec/ruby/library/time/to_time_spec.rb
  219. +1 −1 spec/ruby/library/win32ole/win32ole_method/new_spec.rb
  220. +1 −1 spec/ruby/library/yaml/shared/each_document.rb
  221. +1 −1 spec/ruby/library/yaml/to_yaml_spec.rb
  222. +1 −1 spec/ruby/optional/capi/encoding_spec.rb
  223. +14 −0 spec/ruby/optional/capi/ext/kernel_spec.c
  224. +1 −0 spec/ruby/optional/capi/ext/rubyspec.h
  225. +16 −0 spec/ruby/optional/capi/ext/string_spec.c
  226. +1 −1 spec/ruby/optional/capi/io_spec.rb
  227. +10 −0 spec/ruby/optional/capi/kernel_spec.rb
  228. +7 −0 spec/ruby/optional/capi/object_spec.rb
  229. +1 −1 spec/ruby/optional/capi/proc_spec.rb
  230. +7 −0 spec/ruby/optional/capi/spec_helper.rb
  231. +30 −5 spec/ruby/optional/capi/string_spec.rb
  232. +6 −3 spec/ruby/optional/capi/thread_spec.rb
  233. +6 −6 spec/ruby/shared/fiber/resume.rb
  234. +3 −3 spec/ruby/shared/rational/minus.rb
  235. +3 −3 spec/ruby/shared/rational/plus.rb
  236. +25 −0 spec/ruby/shared/rational/round.rb
  237. +11 −0 spec/ruby/spec_helper.rb
8 changes: 4 additions & 4 deletions spec/mspec/.travis.yml
Original file line number Diff line number Diff line change
@@ -7,12 +7,12 @@ script:
- bundle exec rspec
matrix:
include:
- rvm: 2.2.7
- rvm: 2.3.4
- rvm: 2.4.1
- rvm: 2.2.8
- rvm: 2.3.5
- rvm: 2.4.2
- rvm: ruby-head
- jdk: oraclejdk8
install:
- curl -L https://github.com/graalvm/truffleruby/releases/download/vm-enterprise-0.27/truffleruby-testing-0.27.tar.gz | tar xz
- curl -L https://github.com/graalvm/truffleruby/releases/download/vm-enterprise-0.28/truffleruby-testing-0.28.tar.gz | tar xz
- source truffleruby/setup_env
- bundle install
3 changes: 2 additions & 1 deletion spec/mspec/lib/mspec/commands/mspec.rb
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ def options(argv=ARGV)

options.targets

options.on("--warnings", "Don't supress warnings") do
options.on("--warnings", "Don't suppress warnings") do
config[:flags] << '-w'
ENV['OUTPUT_WARNINGS'] = '1'
end
@@ -171,6 +171,7 @@ def run
exit multi_exec(argv)
else
$stderr.puts "$ #{argv.join(' ')}"
$stderr.flush
exec(*argv, close_others: false)
end
end
34 changes: 19 additions & 15 deletions spec/mspec/lib/mspec/matchers/complain.rb
Original file line number Diff line number Diff line change
@@ -7,44 +7,48 @@ def initialize(complaint)

def matches?(proc)
@saved_err = $stderr
@stderr = $stderr = IOStub.new
@verbose = $VERBOSE
$VERBOSE = false

proc.call
begin
err = $stderr = IOStub.new
$VERBOSE = false
Thread.current[:in_mspec_complain_matcher] = true
proc.call
ensure
$VERBOSE = @verbose
$stderr = @saved_err
Thread.current[:in_mspec_complain_matcher] = false
end

@warning = err.to_s
unless @complaint.nil?
case @complaint
when Regexp
return false unless $stderr =~ @complaint
return false unless @warning =~ @complaint
else
return false unless $stderr == @complaint
return false unless @warning == @complaint
end
end

return $stderr.empty? ? false : true
ensure
$VERBOSE = @verbose
$stderr = @saved_err
return @warning.empty? ? false : true
end

def failure_message
if @complaint.nil?
["Expected a warning", "but received none"]
elsif @complaint.kind_of? Regexp
["Expected warning to match: #{@complaint.inspect}", "but got: #{@stderr.chomp.inspect}"]
["Expected warning to match: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
else
["Expected warning: #{@complaint.inspect}", "but got: #{@stderr.chomp.inspect}"]
["Expected warning: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
end
end

def negative_failure_message
if @complaint.nil?
["Unexpected warning: ", @stderr.chomp.inspect]
["Unexpected warning: ", @warning.chomp.inspect]
elsif @complaint.kind_of? Regexp
["Expected warning not to match: #{@complaint.inspect}", "but got: #{@stderr.chomp.inspect}"]
["Expected warning not to match: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
else
["Expected warning: #{@complaint.inspect}", "but got: #{@stderr.chomp.inspect}"]
["Expected warning: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
end
end
end
2 changes: 1 addition & 1 deletion spec/mspec/lib/mspec/mocks/mock.rb
Original file line number Diff line number Diff line change
@@ -163,7 +163,7 @@ def self.verify_call(obj, sym, *args, &block)
end

if sym.to_sym == :respond_to?
mock_respond_to? obj, compare
mock_respond_to? obj, *args
else
SpecExpectation.fail_with("Mock '#{name_or_inspect obj}': method #{sym}\n",
"called with unexpected arguments (#{Array(compare).join(' ')})")
2 changes: 1 addition & 1 deletion spec/mspec/lib/mspec/runner/context.rb
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
#--
# A note on naming: this is named _ContextState_ rather
# than _DescribeState_ because +describe+ is the keyword
# in the DSL for refering to the context in which an example
# in the DSL for referring to the context in which an example
# is evaluated, just as +it+ refers to the example itself.
#++
class ContextState
34 changes: 18 additions & 16 deletions spec/mspec/lib/mspec/utils/script.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'mspec/guards/guard'
require 'mspec/guards/version'
require 'mspec/utils/warnings'

# MSpecScript provides a skeleton for all the MSpec runner scripts.
@@ -38,7 +39,7 @@ def self.get(key)
end

def initialize
if RUBY_VERSION < '2.2'
ruby_version_is ""..."2.2" do
abort "MSpec needs Ruby 2.2 or more recent"
end

@@ -200,27 +201,30 @@ def entries(partial)
abort "Could not find spec file #{partial}"
end

# Resolves each entry in +list+ to a set of files.
# Resolves each entry in +patterns+ to a set of files.
#
# If the entry has a leading '^' character, the list of files
# If the pattern has a leading '^' character, the list of files
# is subtracted from the list of files accumulated to that point.
#
# If the entry has a leading ':' character, the corresponding
# key is looked up in the config object and the entries in the
# value retrieved are processed through #entries.
def files(list)
list.inject([]) do |files, item|
case item[0]
def files(patterns)
list = []
patterns.each do |pattern|
case pattern[0]
when ?^
files -= entries(item[1..-1])
list -= entries(pattern[1..-1])
when ?:
key = item[1..-1].to_sym
files += files(Array(config[key]))
key = pattern[1..-1].to_sym
value = config[key]
abort "Key #{pattern} not found in mspec config." unless value
list += files(Array(value))
else
files += entries(item)
list += entries(pattern)
end
files
end
list
end

def files_from_patterns(patterns)
@@ -231,12 +235,10 @@ def files_from_patterns(patterns)
if patterns.empty? and File.directory? "./spec"
patterns = ["spec/"]
end
if patterns.empty?
puts "No files specified."
exit 1
end
end
files patterns
list = files(patterns)
abort "No files specified." if list.empty?
list
end

def cores(max)
14 changes: 12 additions & 2 deletions spec/mspec/lib/mspec/utils/warnings.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'mspec/guards/version'

if RUBY_ENGINE == "ruby" and RUBY_VERSION >= "2.4.0"
if RUBY_ENGINE == "ruby" and ruby_version_is("2.4")
ruby_version_is "2.4"..."2.5" do
# Kernel#warn does not delegate to Warning.warn in 2.4
module Kernel
@@ -16,9 +16,19 @@ def warn(*messages)
end

def Warning.warn(message)
if Thread.current[:in_mspec_complain_matcher]
return $stderr.write(message)
end

case message
# $VERBOSE = true warnings
when /possibly useless use of (<|<=|==|>=|>|\+|-) in void context/
when /(.+\.rb):(\d+):.+possibly useless use of (<|<=|==|>=|>) in void context/
# Make sure there is a .should otherwise it is missing
line_nb = Integer($2)
unless File.exist?($1) and /\.should(_not)? (<|<=|==|>=|>)/ === File.readlines($1)[line_nb-1]
$stderr.write message
end
when /possibly useless use of (\+|-) in void context/
when /assigned but unused variable/
when /method redefined/
when /previous definition of/
11 changes: 2 additions & 9 deletions spec/mspec/spec/commands/mspec_run_spec.rb
Original file line number Diff line number Diff line change
@@ -17,8 +17,6 @@

describe MSpecRun, "#options" do
before :each do
@stdout, $stdout = $stdout, IOStub.new

@argv = [one_spec, two_spec]
@options, @config = new_option
MSpecOptions.stub(:new).and_return(@options)
@@ -27,10 +25,6 @@
@script.stub(:config).and_return(@config)
end

after :each do
$stdout = @stdout
end

it "enables the filter options" do
@options.should_receive(:filters)
@script.options @argv
@@ -114,15 +108,14 @@
it "exits if there are no files to process and './spec' is not a directory" do
File.should_receive(:directory?).with("./spec").and_return(false)
@options.should_receive(:parse).and_return([])
@script.should_receive(:exit)
@script.should_receive(:abort).with("No files specified.")
@script.options
$stdout.should include "No files specified"
end

it "process 'spec/' if it is a directory and no files were specified" do
File.should_receive(:directory?).with("./spec").and_return(true)
@options.should_receive(:parse).and_return([])
@script.should_receive(:files).with(["spec/"])
@script.should_receive(:files).with(["spec/"]).and_return(["spec/a_spec.rb"])
@script.options
end

6 changes: 3 additions & 3 deletions spec/mspec/spec/mocks/mock_spec.rb
Original file line number Diff line number Diff line change
@@ -284,21 +284,21 @@ class MockAndRaiseError < Exception; end
ScratchPad.recorded.should == 1
end

it "raises an expection when it is expected to yield but no block is given" do
it "raises an exception when it is expected to yield but no block is given" do
@proxy.and_yield(1, 2, 3)
lambda {
Mock.verify_call(@mock, :method_call)
}.should raise_error(SpecExpectationNotMetError)
end

it "raises an expection when it is expected to yield more arguments than the block can take" do
it "raises an exception when it is expected to yield more arguments than the block can take" do
@proxy.and_yield(1, 2, 3)
lambda {
Mock.verify_call(@mock, :method_call) {|a, b|}
}.should raise_error(SpecExpectationNotMetError)
end

it "does not raise an expection when it is expected to yield to a block that can take any number of arguments" do
it "does not raise an exception when it is expected to yield to a block that can take any number of arguments" do
@proxy.and_yield(1, 2, 3)
expect {
Mock.verify_call(@mock, :method_call) {|*a|}
8 changes: 4 additions & 4 deletions spec/mspec/spec/runner/filters/profile_spec.rb
Original file line number Diff line number Diff line change
@@ -15,25 +15,25 @@
@filter.find(@file).should == @file
end

it "attemps to locate the file in 'spec/profiles'" do
it "attempts to locate the file in 'spec/profiles'" do
path = File.join "spec/profiles", @file
File.should_receive(:exist?).with(path).and_return(true)
@filter.find(@file).should == path
end

it "attemps to locate the file in 'spec'" do
it "attempts to locate the file in 'spec'" do
path = File.join "spec", @file
File.should_receive(:exist?).with(path).and_return(true)
@filter.find(@file).should == path
end

it "attemps to locate the file in 'profiles'" do
it "attempts to locate the file in 'profiles'" do
path = File.join "profiles", @file
File.should_receive(:exist?).with(path).and_return(true)
@filter.find(@file).should == path
end

it "attemps to locate the file in '.'" do
it "attempts to locate the file in '.'" do
path = File.join ".", @file
File.should_receive(:exist?).with(path).and_return(true)
@filter.find(@file).should == path
9 changes: 5 additions & 4 deletions spec/mspec/spec/utils/script_spec.rb
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ class MSSClass < MSpecScript; end
@script.load(@base).should == :loaded
end

it "attemps to locate the file in '.'" do
it "attempts to locate the file in '.'" do
path = File.expand_path @file, "."
File.should_receive(:exist?).with(path).and_return(true)
Kernel.should_receive(:load).with(path).and_return(:loaded)
@@ -186,7 +186,7 @@ class MSSClass < MSpecScript; end
@script.load(@base).should == :loaded
end

it "attemps to locate the file in 'spec'" do
it "attempts to locate the file in 'spec'" do
path = File.expand_path @file, "spec"
File.should_receive(:exist?).with(path).and_return(true)
Kernel.should_receive(:load).with(path).and_return(:loaded)
@@ -438,8 +438,9 @@ class MSSClass < MSpecScript; end
@script.files([":files"]).should == ["file1", "file2"]
end

it "returns an empty list if the config key is not set" do
@script.files([":all_files"]).should == []
it "aborts if the config key is not set" do
@script.should_receive(:abort).with("Key :all_files not found in mspec config.")
@script.files([":all_files"])
end
end

21 changes: 20 additions & 1 deletion spec/ruby/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -7,13 +7,28 @@ AllCops:
- command_line/fixtures/bad_syntax.rb
DisabledByDefault: true

Layout/TrailingWhitespace:
Enabled: true

Lint:
Enabled: true

Lint/AssignmentInCondition:
Enabled: false

Lint/LiteralInCondition:
Lint/BooleanSymbol:
Enabled: false

Lint/InterpolationCheck:
Enabled: false

Lint/LiteralAsCondition:
Enabled: false

Lint/UnneededRequireStatement:
Enabled: false

Lint/RescueWithoutErrorClass:
Enabled: false

Lint/UnifiedInteger:
@@ -38,3 +53,7 @@ Lint/Void:
Lint/EmptyExpression:
Exclude:
- 'language/**/*.rb'

Lint/UriRegexp:
Exclude:
- 'library/uri/regexp_spec.rb'
Loading