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

Commits on Jun 27, 2018

  1. Update to ruby/mspec@7074b56

    eregon committed Jun 27, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stepankuzmin Stepan Kuzmin
    Copy the full SHA
    cd2b347 View commit details
  2. Update to ruby/spec@98c7d74

    eregon committed Jun 27, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stepankuzmin Stepan Kuzmin
    Copy the full SHA
    3f04c76 View commit details
  3. Add tags for failing specs

    eregon committed Jun 27, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stepankuzmin Stepan Kuzmin
    Copy the full SHA
    800cd05 View commit details
  4. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stepankuzmin Stepan Kuzmin
    Copy the full SHA
    6598331 View commit details
Showing with 584 additions and 264 deletions.
  1. +5 −6 spec/mspec/.travis.yml
  2. +4 −0 spec/mspec/lib/mspec/guards/feature.rb
  3. +1 −1 spec/mspec/lib/mspec/matchers/be_close.rb
  4. +40 −0 spec/mspec/spec/guards/feature_spec.rb
  5. +6 −4 spec/mspec/spec/matchers/be_close_spec.rb
  6. +16 −16 spec/mspec/tool/sync/sync-rubyspec.rb
  7. +5 −0 spec/ruby/.rubocop.yml
  8. +0 −2 spec/ruby/.rubocop_todo.yml
  9. +1 −1 spec/ruby/command_line/dash_e_spec.rb
  10. +67 −0 spec/ruby/command_line/rubylib_spec.rb
  11. +2 −2 spec/ruby/command_line/rubyopt_spec.rb
  12. +0 −1 spec/ruby/core/class/inherited_spec.rb
  13. +0 −1 spec/ruby/core/enumerable/zip_spec.rb
  14. +0 −2 spec/ruby/core/env/shared/key.rb
  15. +0 −1 spec/ruby/core/exception/uncaught_throw_error_spec.rb
  16. +0 −1 spec/ruby/core/float/shared/arithmetic_exception_in_coerce.rb
  17. +0 −1 spec/ruby/core/float/shared/comparison_exception_in_coerce.rb
  18. +0 −1 spec/ruby/core/hash/clone_spec.rb
  19. +0 −1 spec/ruby/core/hash/has_key_spec.rb
  20. +0 −1 spec/ruby/core/hash/has_value_spec.rb
  21. +0 −1 spec/ruby/core/hash/value_spec.rb
  22. +0 −1 spec/ruby/core/integer/abs_spec.rb
  23. +0 −1 spec/ruby/core/integer/divide_spec.rb
  24. +0 −1 spec/ruby/core/integer/equal_value_spec.rb
  25. +0 −1 spec/ruby/core/integer/gt_spec.rb
  26. +0 −1 spec/ruby/core/integer/gte_spec.rb
  27. +0 −1 spec/ruby/core/integer/lt_spec.rb
  28. +0 −1 spec/ruby/core/integer/lte_spec.rb
  29. +0 −1 spec/ruby/core/integer/magnitude_spec.rb
  30. +0 −1 spec/ruby/core/integer/minus_spec.rb
  31. +0 −1 spec/ruby/core/integer/multiply_spec.rb
  32. +0 −1 spec/ruby/core/integer/plus_spec.rb
  33. +0 −1 spec/ruby/core/io/pos_spec.rb
  34. +0 −1 spec/ruby/core/io/print_spec.rb
  35. +21 −0 spec/ruby/core/io/shared/write.rb
  36. +0 −1 spec/ruby/core/kernel/eql_spec.rb
  37. +128 −0 spec/ruby/core/kernel/eval_spec.rb
  38. +0 −1 spec/ruby/core/kernel/lambda_spec.rb
  39. +0 −1 spec/ruby/core/kernel/printf_spec.rb
  40. +0 −1 spec/ruby/core/module/protected_spec.rb
  41. +10 −2 spec/ruby/core/process/wait2_spec.rb
  42. +4 −0 spec/ruby/core/process/wait_spec.rb
  43. +0 −1 spec/ruby/core/string/clone_spec.rb
  44. +0 −1 spec/ruby/core/string/percent_spec.rb
  45. +0 −1 spec/ruby/core/systemexit/initialize_spec.rb
  46. +0 −1 spec/ruby/core/thread/run_spec.rb
  47. +0 −1 spec/ruby/core/time/_dump_spec.rb
  48. +0 −1 spec/ruby/core/tracepoint/callee_id_spec.rb
  49. +1 −0 spec/ruby/default.mspec
  50. +37 −0 spec/ruby/language/constants_spec.rb
  51. +0 −1 spec/ruby/language/fixtures/metaclass.rb
  52. +10 −7 spec/ruby/language/if_spec.rb
  53. +4 −2 spec/ruby/language/precedence_spec.rb
  54. +0 −1 spec/ruby/library/bigdecimal/finite_spec.rb
  55. +0 −1 spec/ruby/library/bigdecimal/precs_spec.rb
  56. +0 −1 spec/ruby/library/bigdecimal/quo_spec.rb
  57. +0 −1 spec/ruby/library/bigdecimal/sign_spec.rb
  58. +0 −2 spec/ruby/library/bigdecimal/split_spec.rb
  59. +0 −1 spec/ruby/library/bigdecimal/to_f_spec.rb
  60. +0 −1 spec/ruby/library/bigdecimal/to_s_spec.rb
  61. +0 −3 spec/ruby/library/bigdecimal/uplus_spec.rb
  62. +0 −1 spec/ruby/library/bigdecimal/zero_spec.rb
  63. +0 −1 spec/ruby/library/date/commercial_spec.rb
  64. +0 −1 spec/ruby/library/date/gregorian_leap_spec.rb
  65. +0 −1 spec/ruby/library/date/ordinal_spec.rb
  66. +0 −1 spec/ruby/library/date/valid_civil_spec.rb
  67. +0 −2 spec/ruby/library/date/valid_commercial_spec.rb
  68. +0 −1 spec/ruby/library/date/valid_jd_spec.rb
  69. +0 −1 spec/ruby/library/date/valid_ordinal_spec.rb
  70. +0 −1 spec/ruby/library/digest/md5/block_length_spec.rb
  71. +0 −1 spec/ruby/library/digest/md5/digest_length_spec.rb
  72. +0 −1 spec/ruby/library/digest/md5/equal_spec.rb
  73. +0 −1 spec/ruby/library/digest/md5/inspect_spec.rb
  74. +0 −1 spec/ruby/library/digest/md5/length_spec.rb
  75. +0 −1 spec/ruby/library/digest/md5/reset_spec.rb
  76. +0 −1 spec/ruby/library/digest/md5/size_spec.rb
  77. +0 −1 spec/ruby/library/digest/sha256/block_length_spec.rb
  78. +0 −1 spec/ruby/library/digest/sha256/digest_length_spec.rb
  79. +0 −1 spec/ruby/library/digest/sha256/equal_spec.rb
  80. +0 −1 spec/ruby/library/digest/sha256/inspect_spec.rb
  81. +0 −1 spec/ruby/library/digest/sha256/length_spec.rb
  82. +0 −1 spec/ruby/library/digest/sha256/reset_spec.rb
  83. +0 −1 spec/ruby/library/digest/sha256/size_spec.rb
  84. +0 −1 spec/ruby/library/digest/sha384/block_length_spec.rb
  85. +0 −1 spec/ruby/library/digest/sha384/digest_length_spec.rb
  86. +0 −1 spec/ruby/library/digest/sha384/equal_spec.rb
  87. +0 −1 spec/ruby/library/digest/sha384/inspect_spec.rb
  88. +0 −1 spec/ruby/library/digest/sha384/length_spec.rb
  89. +0 −1 spec/ruby/library/digest/sha384/reset_spec.rb
  90. +0 −1 spec/ruby/library/digest/sha384/size_spec.rb
  91. +0 −1 spec/ruby/library/digest/sha512/block_length_spec.rb
  92. +0 −1 spec/ruby/library/digest/sha512/digest_length_spec.rb
  93. +0 −1 spec/ruby/library/digest/sha512/equal_spec.rb
  94. +0 −1 spec/ruby/library/digest/sha512/inspect_spec.rb
  95. +0 −1 spec/ruby/library/digest/sha512/length_spec.rb
  96. +0 −1 spec/ruby/library/digest/sha512/reset_spec.rb
  97. +0 −1 spec/ruby/library/digest/sha512/size_spec.rb
  98. +0 −1 spec/ruby/library/erb/run_spec.rb
  99. +0 −1 spec/ruby/library/erb/util/html_escape_spec.rb
  100. +0 −1 spec/ruby/library/erb/util/u_spec.rb
  101. +48 −42 spec/ruby/library/etc/getgrgid_spec.rb
  102. +5 −1 spec/ruby/library/etc/struct_group_spec.rb
  103. +0 −2 spec/ruby/library/ipaddr/ipv4_conversion_spec.rb
  104. +14 −0 spec/ruby/library/net/http/HTTPClientExcepton_spec.rb
  105. +19 −5 spec/ruby/library/net/http/HTTPServerException_spec.rb
  106. +0 −1 spec/ruby/library/net/http/http/head2_spec.rb
  107. +0 −1 spec/ruby/library/net/http/http/post_spec.rb
  108. +0 −1 spec/ruby/library/net/http/httpheader/each_capitalized_spec.rb
  109. +6 −1 spec/ruby/library/net/http/httpresponse/error_spec.rb
  110. +6 −1 spec/ruby/library/net/http/httpresponse/error_type_spec.rb
  111. +6 −1 spec/ruby/library/net/http/httpresponse/exception_type_spec.rb
  112. +0 −1 spec/ruby/library/net/http/httpresponse/read_body_spec.rb
  113. +6 −1 spec/ruby/library/net/http/httpresponse/value_spec.rb
  114. +0 −1 spec/ruby/library/pathname/absolute_spec.rb
  115. +0 −1 spec/ruby/library/pathname/equal_value_spec.rb
  116. +0 −1 spec/ruby/library/pathname/hash_spec.rb
  117. +0 −1 spec/ruby/library/pathname/parent_spec.rb
  118. +0 −1 spec/ruby/library/pathname/relative_spec.rb
  119. +0 −1 spec/ruby/library/pathname/root_spec.rb
  120. +0 −1 spec/ruby/library/pathname/sub_spec.rb
  121. +11 −0 spec/ruby/library/rbconfig/rbconfig_spec.rb
  122. +0 −1 spec/ruby/library/rexml/attribute/inspect_spec.rb
  123. +0 −1 spec/ruby/library/rexml/attribute/to_string_spec.rb
  124. +0 −1 spec/ruby/library/rexml/attribute/value_spec.rb
  125. +0 −1 spec/ruby/library/rexml/attribute/xpath_spec.rb
  126. +0 −3 spec/ruby/library/rexml/attributes/each_attribute_spec.rb
  127. +0 −2 spec/ruby/library/rexml/attributes/each_spec.rb
  128. +0 −1 spec/ruby/library/rexml/attributes/element_reference_spec.rb
  129. +0 −1 spec/ruby/library/rexml/attributes/element_set_spec.rb
  130. +0 −1 spec/ruby/library/rexml/attributes/to_a_spec.rb
  131. +0 −1 spec/ruby/library/rexml/element/add_namespace_spec.rb
  132. +0 −2 spec/ruby/library/rexml/element/document_spec.rb
  133. +0 −1 spec/ruby/library/rexml/node/parent_spec.rb
  134. +0 −1 spec/ruby/library/rexml/text/indent_text_spec.rb
  135. +0 −1 spec/ruby/library/rexml/text/new_spec.rb
  136. +0 −1 spec/ruby/library/rexml/text/read_with_substitution_spec.rb
  137. +0 −1 spec/ruby/library/rexml/text/to_s_spec.rb
  138. +0 −1 spec/ruby/library/rexml/text/wrap_spec.rb
  139. +0 −1 spec/ruby/library/set/case_compare_spec.rb
  140. +1 −1 spec/ruby/library/socket/socket/getaddrinfo_spec.rb
  141. +0 −1 spec/ruby/library/stringio/each_codepoint_spec.rb
  142. +0 −1 spec/ruby/library/stringio/open_spec.rb
  143. +0 −1 spec/ruby/library/stringio/printf_spec.rb
  144. +0 −1 spec/ruby/library/stringio/stringio_spec.rb
  145. +0 −1 spec/ruby/library/stringscanner/element_reference_spec.rb
  146. +0 −1 spec/ruby/library/stringscanner/peek_spec.rb
  147. +0 −1 spec/ruby/library/tempfile/open_spec.rb
  148. +0 −2 spec/ruby/library/uri/set_component_spec.rb
  149. +0 −1 spec/ruby/library/zlib/deflate/set_dictionary_spec.rb
  150. +0 −1 spec/ruby/library/zlib/gzipfile/close_spec.rb
  151. +0 −1 spec/ruby/library/zlib/gzipfile/closed_spec.rb
  152. +0 −1 spec/ruby/library/zlib/gzipfile/comment_spec.rb
  153. +0 −1 spec/ruby/library/zlib/gzipfile/orig_name_spec.rb
  154. +0 −1 spec/ruby/library/zlib/gzipreader/pos_spec.rb
  155. +0 −1 spec/ruby/library/zlib/inflate/set_dictionary_spec.rb
  156. +0 −2 spec/ruby/library/zlib/zstream/flush_next_out_spec.rb
  157. +0 −5 spec/ruby/optional/capi/data_spec.rb
  158. +27 −0 spec/ruby/optional/capi/enumerator_spec.rb
  159. +0 −7 spec/ruby/optional/capi/ext/data_spec.c
  160. +15 −0 spec/ruby/optional/capi/ext/enumerator_spec.c
  161. +11 −0 spec/ruby/optional/capi/ext/kernel_spec.c
  162. +3 −0 spec/ruby/optional/capi/ext/rubyspec.h
  163. +11 −1 spec/ruby/optional/capi/ext/string_spec.c
  164. +0 −7 spec/ruby/optional/capi/ext/typed_data_spec.c
  165. +7 −0 spec/ruby/optional/capi/kernel_spec.rb
  166. +0 −1 spec/ruby/optional/capi/rake_helper.rb
  167. +19 −0 spec/ruby/optional/capi/string_spec.rb
  168. +0 −5 spec/ruby/optional/capi/typed_data_spec.rb
  169. +3 −3 spec/ruby/shared/rational/exponent.rb
  170. +1 −0 spec/tags/ruby/core/kernel/eval_tags.txt
  171. +1 −0 spec/tags/ruby/core/thread/backtrace_tags.txt
  172. +2 −0 spec/tags/ruby/language/constants_tags.txt
11 changes: 5 additions & 6 deletions spec/mspec/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
sudo: false
language: ruby
before_script:
# https://github.com/travis-ci/travis-ci/issues/8408
- unset _JAVA_OPTIONS
script:
- bundle exec rspec
matrix:
@@ -23,8 +20,10 @@ matrix:
# https://github.com/travis-ci/travis-ci/issues/8978
- gem update --system
- gem install bundler
- jdk: oraclejdk8
- rvm: system
install:
- curl -L https://github.com/oracle/truffleruby/releases/download/vm-enterprise-0.28/truffleruby-testing-0.28.tar.gz | tar xz
- source truffleruby/setup_env
- curl -L https://github.com/oracle/truffleruby/releases/download/vm-1.0.0-rc2/truffleruby-1.0.0-rc2-linux-amd64.tar.gz | tar xz
- export PATH="$PWD/truffleruby-1.0.0-rc2-linux-amd64/bin:$PATH"
- $PWD/truffleruby-1.0.0-rc2-linux-amd64/lib/truffle/post_install_hook.sh
- gem install bundler
- bundle install
4 changes: 4 additions & 0 deletions spec/mspec/lib/mspec/guards/feature.rb
Original file line number Diff line number Diff line change
@@ -39,3 +39,7 @@ def match?
def with_feature(*features, &block)
FeatureGuard.new(*features).run_if(:with_feature, &block)
end

def without_feature(*features, &block)
FeatureGuard.new(*features).run_unless(:without_feature, &block)
end
2 changes: 1 addition & 1 deletion spec/mspec/lib/mspec/matchers/be_close.rb
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ def initialize(expected, tolerance)

def matches?(actual)
@actual = actual
(@actual - @expected).abs < @tolerance
(@actual - @expected).abs <= @tolerance
end

def failure_message
40 changes: 40 additions & 0 deletions spec/mspec/spec/guards/feature_spec.rb
Original file line number Diff line number Diff line change
@@ -78,3 +78,43 @@
ScratchPad.recorded.should be_nil
end
end

describe Object, "#without_feature" do
before :each do
ScratchPad.clear

@guard = FeatureGuard.new :encoding
FeatureGuard.stub(:new).and_return(@guard)
end

it "sets the name of the guard to :without_feature" do
without_feature(:encoding) { }
@guard.name.should == :without_feature
end

it "calls #unregister even when an exception is raised in the guard block" do
@guard.should_receive(:match?).and_return(false)
@guard.should_receive(:unregister)
lambda do
without_feature { raise Exception }
end.should raise_error(Exception)
end
end

describe Object, "#without_feature" do
before :each do
ScratchPad.clear
end

it "does not yield if the feature is enabled" do
MSpec.should_receive(:feature_enabled?).with(:encoding).and_return(true)
without_feature(:encoding) { ScratchPad.record :yield }
ScratchPad.recorded.should be_nil
end

it "yields if the feature is disabled" do
MSpec.should_receive(:feature_enabled?).with(:encoding).and_return(false)
without_feature(:encoding) { ScratchPad.record :yield }
ScratchPad.recorded.should == :yield
end
end
10 changes: 6 additions & 4 deletions spec/mspec/spec/matchers/be_close_spec.rb
Original file line number Diff line number Diff line change
@@ -16,12 +16,14 @@
BeCloseMatcher.new(5.0, 0.5).matches?(4.51).should == true
end

it "does not match when actual == (expected + tolerance)" do
BeCloseMatcher.new(5.0, 0.5).matches?(5.5).should == false
it "matches when actual == (expected + tolerance)" do
BeCloseMatcher.new(5.0, 0.5).matches?(5.5).should == true
BeCloseMatcher.new(3, 2).matches?(5).should == true
end

it "does not match when actual == (expected - tolerance)" do
BeCloseMatcher.new(5.0, 0.5).matches?(4.5).should == false
it "matches when actual == (expected - tolerance)" do
BeCloseMatcher.new(5.0, 0.5).matches?(4.5).should == true
BeCloseMatcher.new(3, 2).matches?(1).should == true
end

it "does not match when actual < (expected - tolerance)" do
32 changes: 16 additions & 16 deletions spec/mspec/tool/sync/sync-rubyspec.rb
Original file line number Diff line number Diff line change
@@ -159,22 +159,22 @@ def rebase_commits(impl)
def test_new_specs
require "yaml"
Dir.chdir(SOURCE_REPO) do
if MSPEC
sh "bundle", "exec", "rspec"
else
versions = YAML.load_file(".travis.yml")
versions = versions["matrix"]["include"].map { |job| job["rvm"] }
versions.delete "ruby-head"
min_version, max_version = versions.minmax

run_rubyspec = -> version {
command = "chruby #{version} && ../mspec/bin/mspec -j"
sh ENV["SHELL"], "-c", command
}
run_rubyspec[min_version]
run_rubyspec[max_version]
run_rubyspec["trunk"]
end
versions = YAML.load_file(".travis.yml")
versions = versions["matrix"]["include"].map { |job| job["rvm"] }
versions.delete "ruby-head"
versions.delete "system"
min_version, max_version = versions.minmax

test_command = MSPEC ? "bundle exec rspec" : "../mspec/bin/mspec -j"

run_test = -> version {
command = "chruby #{version} && #{test_command}"
sh ENV["SHELL"], "-c", command
}

run_test[min_version]
run_test[max_version]
run_test["trunk"]
end
end

5 changes: 5 additions & 0 deletions spec/ruby/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -10,6 +10,11 @@ AllCops:
Layout/TrailingWhitespace:
Enabled: true

Layout/TrailingBlankLines:
Enabled: true
Exclude:
- library/coverage/fixtures/some_class.rb

Lint:
Enabled: true

2 changes: 0 additions & 2 deletions spec/ruby/.rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -87,12 +87,10 @@ Lint/MultipleCompare:
# Offense count: 12
Lint/ParenthesesAsGroupedExpression:
Exclude:
- 'command_line/rubyopt_spec.rb'
- 'core/string/fixtures/freeze_magic_comment.rb'
- 'language/block_spec.rb'
- 'language/fixtures/send.rb'
- 'language/method_spec.rb'
- 'library/socket/socket/getaddrinfo_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
2 changes: 1 addition & 1 deletion spec/ruby/command_line/dash_e_spec.rb
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@

describe "with -n and a Fixnum range" do
before :each do
@script = "-ne 'print if %s' #{fixture(__FILE__, "conditional_range.txt")}"
@script = "-W0 -ne 'print if %s' #{fixture(__FILE__, "conditional_range.txt")}"
end

it "mimics an awk conditional by comparing an inclusive-end range with $." do
67 changes: 67 additions & 0 deletions spec/ruby/command_line/rubylib_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
require_relative '../spec_helper'

describe "The RUBYLIB environment variable" do
before :each do
@rubylib, ENV["RUBYLIB"] = ENV["RUBYLIB"], nil
end

after :each do
ENV["RUBYLIB"] = @rubylib
end

it "adds a directory to $LOAD_PATH" do
dir = tmp("rubylib/incl")
ENV["RUBYLIB"] = dir
paths = ruby_exe("puts $LOAD_PATH").lines.map(&:chomp)
paths.should include(dir)
end

it "adds a File::PATH_SEPARATOR-separated list of directories to $LOAD_PATH" do
dir1, dir2 = tmp("rubylib/incl1"), tmp("rubylib/incl2")
ENV["RUBYLIB"] = "#{dir1}#{File::PATH_SEPARATOR}#{dir2}"
paths = ruby_exe("puts $LOAD_PATH").lines.map(&:chomp)
paths.should include(dir1)
paths.should include(dir2)
paths.index(dir1).should < paths.index(dir2)
end

it "adds the directory at the front of $LOAD_PATH" do
dir = tmp("rubylib/incl_front")
ENV["RUBYLIB"] = dir
paths = ruby_exe("puts $LOAD_PATH").lines.map(&:chomp)
if PlatformGuard.implementation? :ruby
# In a MRI checkout, $PWD and some extra -I entries end up as
# the first entries in $LOAD_PATH. So just assert that it's not last.
idx = paths.index(dir)
idx.should < paths.size-1
else
paths[0].should == dir
end
end

it "adds the directory after directories added by -I" do
dash_i_dir = tmp("dash_I_include")
rubylib_dir = tmp("rubylib_include")
ENV["RUBYLIB"] = rubylib_dir
paths = ruby_exe("puts $LOAD_PATH", options: "-I #{dash_i_dir}").lines.map(&:chomp)
paths.should include(dash_i_dir)
paths.should include(rubylib_dir)
paths.index(dash_i_dir).should < paths.index(rubylib_dir)
end

it "adds the directory after directories added by -I within RUBYOPT" do
rubyopt_dir = tmp("rubyopt_include")
rubylib_dir = tmp("rubylib_include")
ENV["RUBYLIB"] = rubylib_dir
paths = ruby_exe("puts $LOAD_PATH", env: { "RUBYOPT" => "-I#{rubyopt_dir}" }).lines.map(&:chomp)
paths.should include(rubyopt_dir)
paths.should include(rubylib_dir)
paths.index(rubyopt_dir).should < paths.index(rubylib_dir)
end

it "keeps spaces in the value" do
ENV["RUBYLIB"] = " rubylib/incl "
out = ruby_exe("puts $LOAD_PATH")
out.should include(" rubylib/incl ")
end
end
4 changes: 2 additions & 2 deletions spec/ruby/command_line/rubyopt_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require_relative '../spec_helper'

describe "Processing RUBYOPT" do
before (:each) do
before :each do
@rubyopt, ENV["RUBYOPT"] = ENV["RUBYOPT"], nil
end

after (:each) do
after :each do
ENV["RUBYOPT"] = @rubyopt
end

1 change: 0 additions & 1 deletion spec/ruby/core/class/inherited_spec.rb
Original file line number Diff line number Diff line change
@@ -99,4 +99,3 @@ class << top; protected :inherited; end
end

end

1 change: 0 additions & 1 deletion spec/ruby/core/enumerable/zip_spec.rb
Original file line number Diff line number Diff line change
@@ -39,4 +39,3 @@
end

end

2 changes: 0 additions & 2 deletions spec/ruby/core/env/shared/key.rb
Original file line number Diff line number Diff line change
@@ -11,5 +11,3 @@
ENV.send(@method, "should_never_be_set").should be_nil
end
end


1 change: 0 additions & 1 deletion spec/ruby/core/exception/uncaught_throw_error_spec.rb
Original file line number Diff line number Diff line change
@@ -16,4 +16,3 @@
end
end
end

Original file line number Diff line number Diff line change
@@ -31,4 +31,3 @@
end
end
end

Original file line number Diff line number Diff line change
@@ -33,4 +33,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/hash/clone_spec.rb
Original file line number Diff line number Diff line change
@@ -10,4 +10,3 @@
clone.should_not equal hash
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/hash/has_key_spec.rb
Original file line number Diff line number Diff line change
@@ -5,4 +5,3 @@
describe "Hash#has_key?" do
it_behaves_like :hash_key_p, :has_key?
end

1 change: 0 additions & 1 deletion spec/ruby/core/hash/has_value_spec.rb
Original file line number Diff line number Diff line change
@@ -5,4 +5,3 @@
describe "Hash#has_value?" do
it_behaves_like :hash_value_p, :has_value?
end

1 change: 0 additions & 1 deletion spec/ruby/core/hash/value_spec.rb
Original file line number Diff line number Diff line change
@@ -5,4 +5,3 @@
describe "Hash#value?" do
it_behaves_like :hash_value_p, :value?
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/abs_spec.rb
Original file line number Diff line number Diff line change
@@ -4,4 +4,3 @@
describe "Integer#abs" do
it_behaves_like :integer_abs, :abs
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/divide_spec.rb
Original file line number Diff line number Diff line change
@@ -93,4 +93,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/equal_value_spec.rb
Original file line number Diff line number Diff line change
@@ -4,4 +4,3 @@
describe "Integer#==" do
it_behaves_like :integer_equal, :==
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/gt_spec.rb
Original file line number Diff line number Diff line change
@@ -47,4 +47,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/gte_spec.rb
Original file line number Diff line number Diff line change
@@ -47,4 +47,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/lt_spec.rb
Original file line number Diff line number Diff line change
@@ -49,4 +49,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/lte_spec.rb
Original file line number Diff line number Diff line change
@@ -52,4 +52,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/magnitude_spec.rb
Original file line number Diff line number Diff line change
@@ -4,4 +4,3 @@
describe "Integer#magnitude" do
it_behaves_like :integer_abs, :magnitude
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/minus_spec.rb
Original file line number Diff line number Diff line change
@@ -47,4 +47,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/multiply_spec.rb
Original file line number Diff line number Diff line change
@@ -49,4 +49,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/integer/plus_spec.rb
Original file line number Diff line number Diff line change
@@ -47,4 +47,3 @@
end
end
end

1 change: 0 additions & 1 deletion spec/ruby/core/io/pos_spec.rb
Original file line number Diff line number Diff line change
@@ -9,4 +9,3 @@
describe "IO#pos=" do
it_behaves_like :io_set_pos, :pos=
end

1 change: 0 additions & 1 deletion spec/ruby/core/io/print_spec.rb
Original file line number Diff line number Diff line change
@@ -51,4 +51,3 @@ def o2.to_s(); 'o2'; end
lambda { IOSpecs.closed_io.print("stuff") }.should raise_error(IOError)
end
end

21 changes: 21 additions & 0 deletions spec/ruby/core/io/shared/write.rb
Original file line number Diff line number Diff line change
@@ -69,4 +69,25 @@
lambda { IOSpecs.closed_io.send(@method, "hello") }.should raise_error(IOError)
end

describe "on a pipe" do
before :each do
@r, @w = IO.pipe
end

after :each do
@r.close
@w.close
end

it "writes the given String to the pipe" do
@w.send(@method, "foo")
@w.close
@r.read.should == "foo"
end

it "raises Errno::EPIPE if the read end is closed" do
@r.close
-> { @w.send(@method, "foo") }.should raise_error(Errno::EPIPE, /Broken pipe/)
end
end
end
Loading