зеркало из https://github.com/github/ruby.git
Fixnum as a Symbol was an old feature until 1.6
This commit is contained in:
Родитель
a365ae841b
Коммит
ad534a677a
|
@ -36,7 +36,7 @@ describe "Module#attr_accessor" do
|
|||
-> { true.spec_attr_accessor = "a" }.should raise_error(RuntimeError)
|
||||
end
|
||||
|
||||
it "converts non string/symbol/fixnum names to strings using to_str" do
|
||||
it "converts non string/symbol names to strings using to_str" do
|
||||
(o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
|
||||
c = Class.new do
|
||||
attr_accessor o
|
||||
|
|
|
@ -32,7 +32,7 @@ describe "Module#attr_reader" do
|
|||
-> { true.instance_variable_set("@spec_attr_reader", "a") }.should raise_error(RuntimeError)
|
||||
end
|
||||
|
||||
it "converts non string/symbol/fixnum names to strings using to_str" do
|
||||
it "converts non string/symbol names to strings using to_str" do
|
||||
(o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
|
||||
c = Class.new do
|
||||
attr_reader o
|
||||
|
|
|
@ -124,7 +124,7 @@ describe "Module#attr" do
|
|||
-> { c.new.bar }.should raise_error(NoMethodError)
|
||||
end
|
||||
|
||||
it "converts non string/symbol/fixnum names to strings using to_str" do
|
||||
it "converts non string/symbol names to strings using to_str" do
|
||||
(o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
|
||||
Class.new { attr o }.new.respond_to?("test").should == true
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ describe "Module#attr_writer" do
|
|||
-> { true.spec_attr_writer = "a" }.should raise_error(RuntimeError)
|
||||
end
|
||||
|
||||
it "converts non string/symbol/fixnum names to strings using to_str" do
|
||||
it "converts non string/symbol names to strings using to_str" do
|
||||
(o = mock('test')).should_receive(:to_str).any_number_of_times.and_return("test")
|
||||
c = Class.new do
|
||||
attr_writer o
|
||||
|
|
|
@ -51,7 +51,7 @@ describe "Module#class_variable_defined?" do
|
|||
}.should raise_error(NameError)
|
||||
end
|
||||
|
||||
it "converts a non string/symbol/fixnum name to string using to_str" do
|
||||
it "converts a non string/symbol name to string using to_str" do
|
||||
c = Class.new { class_variable_set :@@class_var, "test" }
|
||||
(o = mock('@@class_var')).should_receive(:to_str).and_return("@@class_var")
|
||||
c.class_variable_defined?(o).should == true
|
||||
|
|
|
@ -60,7 +60,7 @@ describe "Module#class_variable_get" do
|
|||
-> { c.send(:class_variable_get, "@invalid_name") }.should raise_error(NameError)
|
||||
end
|
||||
|
||||
it "converts a non string/symbol/fixnum name to string using to_str" do
|
||||
it "converts a non string/symbol name to string using to_str" do
|
||||
c = Class.new { class_variable_set :@@class_var, "test" }
|
||||
(o = mock('@@class_var')).should_receive(:to_str).and_return("@@class_var")
|
||||
c.send(:class_variable_get, o).should == "test"
|
||||
|
|
|
@ -45,7 +45,7 @@ describe "Module#class_variable_set" do
|
|||
}.should raise_error(NameError)
|
||||
end
|
||||
|
||||
it "converts a non string/symbol/fixnum name to string using to_str" do
|
||||
it "converts a non string/symbol name to string using to_str" do
|
||||
(o = mock('@@class_var')).should_receive(:to_str).and_return("@@class_var")
|
||||
c = Class.new
|
||||
c.send(:class_variable_set, o, "test")
|
||||
|
|
|
@ -30,7 +30,7 @@ describe "Module#method_defined?" do
|
|||
m.method_defined?(:module_specs_public_method_on_kernel).should be_false
|
||||
end
|
||||
|
||||
it "raises a TypeError when the given object is not a string/symbol/fixnum" do
|
||||
it "raises a TypeError when the given object is not a string/symbol" do
|
||||
c = Class.new
|
||||
o = mock('123')
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче