summaryrefslogtreecommitdiff
path: root/spec/ruby/core/module
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/module')
-rw-r--r--spec/ruby/core/module/define_method_spec.rb2
-rw-r--r--spec/ruby/core/module/instance_method_spec.rb2
-rw-r--r--spec/ruby/core/module/shared/class_eval.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/module/define_method_spec.rb b/spec/ruby/core/module/define_method_spec.rb
index c5dfc53764..a4fe4fad18 100644
--- a/spec/ruby/core/module/define_method_spec.rb
+++ b/spec/ruby/core/module/define_method_spec.rb
@@ -254,7 +254,7 @@ describe "Module#define_method" do
-> {
Class.new { define_method(obj, -> {}) }
- }.should raise_error(TypeError, /can't convert Object to String/)
+ }.should raise_consistent_error(TypeError, /can't convert Object into String/)
end
it "raises a TypeError when the given method is no Method/Proc" do
diff --git a/spec/ruby/core/module/instance_method_spec.rb b/spec/ruby/core/module/instance_method_spec.rb
index 182cdf5c54..c6bc201520 100644
--- a/spec/ruby/core/module/instance_method_spec.rb
+++ b/spec/ruby/core/module/instance_method_spec.rb
@@ -79,7 +79,7 @@ describe "Module#instance_method" do
obj = Object.new
def obj.to_str() [] end
- -> { ModuleSpecs::InstanceMeth.instance_method(obj) }.should raise_error(TypeError, /can't convert Object to String/)
+ -> { ModuleSpecs::InstanceMeth.instance_method(obj) }.should raise_consistent_error(TypeError, /can't convert Object into String/)
end
it "raises a NameError if the method has been undefined" do
diff --git a/spec/ruby/core/module/shared/class_eval.rb b/spec/ruby/core/module/shared/class_eval.rb
index 526d0a2036..b6e653a2ac 100644
--- a/spec/ruby/core/module/shared/class_eval.rb
+++ b/spec/ruby/core/module/shared/class_eval.rb
@@ -66,7 +66,7 @@ describe :module_class_eval, shared: true do
it "raises a TypeError when the given filename can't be converted to string using to_str" do
(file = mock('123')).should_receive(:to_str).and_return(123)
- -> { ModuleSpecs.send(@method, "1+1", file) }.should raise_error(TypeError, /can't convert MockObject to String/)
+ -> { ModuleSpecs.send(@method, "1+1", file) }.should raise_consistent_error(TypeError, /can't convert MockObject into String/)
end
it "converts non string eval-string to string using to_str" do
@@ -85,7 +85,7 @@ describe :module_class_eval, shared: true do
-> { ModuleSpecs.send(@method, o) }.should raise_error(TypeError, "no implicit conversion of MockObject into String")
(o = mock('123')).should_receive(:to_str).and_return(123)
- -> { ModuleSpecs.send(@method, o) }.should raise_error(TypeError, /can't convert MockObject to String/)
+ -> { ModuleSpecs.send(@method, o) }.should raise_consistent_error(TypeError, /can't convert MockObject into String/)
end
it "raises an ArgumentError when no arguments and no block are given" do