Fixnum as a Symbol was an old feature until 1.6

This commit is contained in:
Nobuyoshi Nakada 2020-12-21 00:20:06 +09:00
Родитель a365ae841b
Коммит ad534a677a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7CD2805BFA3770C6
8 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -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')