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/alias_method_spec.rb4
-rw-r--r--spec/ruby/core/module/append_features_spec.rb4
-rw-r--r--spec/ruby/core/module/autoload_spec.rb4
-rw-r--r--spec/ruby/core/module/class_variable_set_spec.rb6
-rw-r--r--spec/ruby/core/module/const_set_spec.rb4
-rw-r--r--spec/ruby/core/module/define_method_spec.rb4
-rw-r--r--spec/ruby/core/module/remove_method_spec.rb8
-rw-r--r--spec/ruby/core/module/undef_method_spec.rb8
8 files changed, 21 insertions, 21 deletions
diff --git a/spec/ruby/core/module/alias_method_spec.rb b/spec/ruby/core/module/alias_method_spec.rb
index d3c0529418..32fc345890 100644
--- a/spec/ruby/core/module/alias_method_spec.rb
+++ b/spec/ruby/core/module/alias_method_spec.rb
@@ -49,9 +49,9 @@ describe "Module#alias_method" do
}
end
- it "raises RuntimeError if frozen" do
+ it "raises #{frozen_error_class} if frozen" do
@class.freeze
- lambda { @class.make_alias :uno, :public_one }.should raise_error(RuntimeError)
+ lambda { @class.make_alias :uno, :public_one }.should raise_error(frozen_error_class)
end
it "converts the names using #to_str" do
diff --git a/spec/ruby/core/module/append_features_spec.rb b/spec/ruby/core/module/append_features_spec.rb
index ceb8c3f8eb..122804ad36 100644
--- a/spec/ruby/core/module/append_features_spec.rb
+++ b/spec/ruby/core/module/append_features_spec.rb
@@ -65,8 +65,8 @@ describe "Module#append_features" do
@other = Module.new.freeze
end
- it "raises a RuntimeError before appending self" do
- lambda { @receiver.send(:append_features, @other) }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} before appending self" do
+ lambda { @receiver.send(:append_features, @other) }.should raise_error(frozen_error_class)
@other.ancestors.should_not include(@receiver)
end
end
diff --git a/spec/ruby/core/module/autoload_spec.rb b/spec/ruby/core/module/autoload_spec.rb
index a72ae7735b..d79e7605be 100644
--- a/spec/ruby/core/module/autoload_spec.rb
+++ b/spec/ruby/core/module/autoload_spec.rb
@@ -329,8 +329,8 @@ describe "Module#autoload" do
end
describe "on a frozen module" do
- it "raises a RuntimeError before setting the name" do
- lambda { @frozen_module.autoload :Foo, @non_existent }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} before setting the name" do
+ lambda { @frozen_module.autoload :Foo, @non_existent }.should raise_error(frozen_error_class)
@frozen_module.should_not have_constant(:Foo)
end
end
diff --git a/spec/ruby/core/module/class_variable_set_spec.rb b/spec/ruby/core/module/class_variable_set_spec.rb
index 6d36298f5f..a65bd28a28 100644
--- a/spec/ruby/core/module/class_variable_set_spec.rb
+++ b/spec/ruby/core/module/class_variable_set_spec.rb
@@ -25,13 +25,13 @@ describe "Module#class_variable_set" do
c.send(:class_variable_get, "@@mvar").should == :new_mvar
end
- it "raises a RuntimeError when self is frozen" do
+ it "raises a #{frozen_error_class} when self is frozen" do
lambda {
Class.new.freeze.send(:class_variable_set, :@@test, "test")
- }.should raise_error(RuntimeError)
+ }.should raise_error(frozen_error_class)
lambda {
Module.new.freeze.send(:class_variable_set, :@@test, "test")
- }.should raise_error(RuntimeError)
+ }.should raise_error(frozen_error_class)
end
it "raises a NameError when the given name is not allowed" do
diff --git a/spec/ruby/core/module/const_set_spec.rb b/spec/ruby/core/module/const_set_spec.rb
index 6f4f6f980f..c6c80bf5df 100644
--- a/spec/ruby/core/module/const_set_spec.rb
+++ b/spec/ruby/core/module/const_set_spec.rb
@@ -78,8 +78,8 @@ describe "Module#const_set" do
@name = :Foo
end
- it "raises a RuntimeError before setting the name" do
- lambda { @frozen.const_set @name, nil }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} before setting the name" do
+ lambda { @frozen.const_set @name, nil }.should raise_error(frozen_error_class)
@frozen.should_not have_constant(@name)
end
end
diff --git a/spec/ruby/core/module/define_method_spec.rb b/spec/ruby/core/module/define_method_spec.rb
index 64ac5306f0..be0e2f0a0b 100644
--- a/spec/ruby/core/module/define_method_spec.rb
+++ b/spec/ruby/core/module/define_method_spec.rb
@@ -247,10 +247,10 @@ describe "Module#define_method" do
lambda { obj.proc_style_test :arg }.should raise_error(ArgumentError)
end
- it "raises a RuntimeError if frozen" do
+ it "raises a #{frozen_error_class} if frozen" do
lambda {
Class.new { freeze; define_method(:foo) {} }
- }.should raise_error(RuntimeError)
+ }.should raise_error(frozen_error_class)
end
it "accepts a Method (still bound)" do
diff --git a/spec/ruby/core/module/remove_method_spec.rb b/spec/ruby/core/module/remove_method_spec.rb
index d82e0c65ca..b2e91bcc1f 100644
--- a/spec/ruby/core/module/remove_method_spec.rb
+++ b/spec/ruby/core/module/remove_method_spec.rb
@@ -97,12 +97,12 @@ describe "Module#remove_method" do
@frozen = @module.dup.freeze
end
- it "raises a RuntimeError when passed a name" do
- lambda { @frozen.send :remove_method, :method_to_remove }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} when passed a name" do
+ lambda { @frozen.send :remove_method, :method_to_remove }.should raise_error(frozen_error_class)
end
- it "raises a RuntimeError when passed a missing name" do
- lambda { @frozen.send :remove_method, :not_exist }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} when passed a missing name" do
+ lambda { @frozen.send :remove_method, :not_exist }.should raise_error(frozen_error_class)
end
it "raises a TypeError when passed a not name" do
diff --git a/spec/ruby/core/module/undef_method_spec.rb b/spec/ruby/core/module/undef_method_spec.rb
index 54c3d37c7f..bb2cbc1f24 100644
--- a/spec/ruby/core/module/undef_method_spec.rb
+++ b/spec/ruby/core/module/undef_method_spec.rb
@@ -68,12 +68,12 @@ describe "Module#undef_method" do
@frozen = @module.dup.freeze
end
- it "raises a RuntimeError when passed a name" do
- lambda { @frozen.send :undef_method, :method_to_undef }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} when passed a name" do
+ lambda { @frozen.send :undef_method, :method_to_undef }.should raise_error(frozen_error_class)
end
- it "raises a RuntimeError when passed a missing name" do
- lambda { @frozen.send :undef_method, :not_exist }.should raise_error(RuntimeError)
+ it "raises a #{frozen_error_class} when passed a missing name" do
+ lambda { @frozen.send :undef_method, :not_exist }.should raise_error(frozen_error_class)
end
it "raises a TypeError when passed a not name" do