summaryrefslogtreecommitdiff
path: root/spec/ruby/core/module
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 15:41:50 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 15:41:50 +0000
commit4d7b0b9112f2adf9e87ef75056f930bf7c1f3dc4 (patch)
tree8d712e18a619a9720d181d0d44e8cc2474ff31ee /spec/ruby/core/module
parent821d9a2d30f2e0d3f9009dc001b4b49aaa63c66e (diff)
Update to ruby/spec@bacedc5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/module')
-rw-r--r--spec/ruby/core/module/fixtures/using.rb10
-rw-r--r--spec/ruby/core/module/refine_spec.rb24
-rw-r--r--spec/ruby/core/module/using_spec.rb21
3 files changed, 27 insertions, 28 deletions
diff --git a/spec/ruby/core/module/fixtures/using.rb b/spec/ruby/core/module/fixtures/using.rb
deleted file mode 100644
index 0ed9355af1..0000000000
--- a/spec/ruby/core/module/fixtures/using.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-module ModuleSpecs
- module EmptyRefinement
- end
-
- module RefinementForStringToS
- refine String do
- def to_s; "hello from refinement"; end
- end
- end
-end
diff --git a/spec/ruby/core/module/refine_spec.rb b/spec/ruby/core/module/refine_spec.rb
index 67832ff676..b54d83075f 100644
--- a/spec/ruby/core/module/refine_spec.rb
+++ b/spec/ruby/core/module/refine_spec.rb
@@ -1,6 +1,3 @@
-
-return ## this code causes double free and now we are debugging.
-
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/refine', __FILE__)
@@ -87,18 +84,20 @@ describe "Module#refine" do
end
end
- ruby_version_is "2.4" do
- it "accepts a module as argument" do
- inner_self = nil
- Module.new do
- refine(Enumerable) do
- def blah
+ quarantine! do # https://bugs.ruby-lang.org/issues/14070
+ ruby_version_is "2.4" do
+ it "accepts a module as argument" do
+ inner_self = nil
+ Module.new do
+ refine(Enumerable) do
+ def blah
+ end
+ inner_self = self
end
- inner_self = self
end
- end
- inner_self.public_instance_methods.should include(:blah)
+ inner_self.public_instance_methods.should include(:blah)
+ end
end
end
@@ -616,4 +615,3 @@ describe "Module#refine" do
end
end
end
-
diff --git a/spec/ruby/core/module/using_spec.rb b/spec/ruby/core/module/using_spec.rb
index 32e8f8f96b..2e7e15b748 100644
--- a/spec/ruby/core/module/using_spec.rb
+++ b/spec/ruby/core/module/using_spec.rb
@@ -1,5 +1,4 @@
require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/using', __FILE__)
describe "Module#using" do
it "imports class refinements from module into the current class/module" do
@@ -90,7 +89,7 @@ describe "Module#using" do
it "raises error in method scope" do
mod = Module.new do
def self.foo
- using ModuleSpecs::EmptyRefinement
+ using Module.new {}
end
end
@@ -156,7 +155,11 @@ describe "Module#using" do
Module.new do
Class.new do
- using ModuleSpecs::RefinementForStringToS
+ using Module.new {
+ refine String do
+ def to_s; "hello from refinement"; end
+ end
+ }
ScratchPad << "1".to_s
end
@@ -175,7 +178,11 @@ describe "Module#using" do
Module.new do
Class.new do
ScratchPad << "1".to_s
- using ModuleSpecs::RefinementForStringToS
+ using Module.new {
+ refine String do
+ def to_s; "hello from refinement"; end
+ end
+ }
ScratchPad << "1".to_s
end
end
@@ -241,7 +248,11 @@ describe "Module#using" do
Module.new do
if false
- using ModuleSpecs::RefinementForStringToS
+ using Module.new {
+ refine String do
+ def to_s; "hello from refinement"; end
+ end
+ }
end
result = "1".to_s
end