From a2024081805af4e729bea029abb7bbe7c383dce2 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 2 Nov 2021 18:29:53 +0900 Subject: Fix typos --- spec/ruby/core/complex/comparision_spec.rb | 27 --------------------------- spec/ruby/core/complex/comparison_spec.rb | 27 +++++++++++++++++++++++++++ spec/ruby/core/struct/values_at_spec.rb | 6 +++--- 3 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 spec/ruby/core/complex/comparision_spec.rb create mode 100644 spec/ruby/core/complex/comparison_spec.rb (limited to 'spec/ruby/core') diff --git a/spec/ruby/core/complex/comparision_spec.rb b/spec/ruby/core/complex/comparision_spec.rb deleted file mode 100644 index 2a437afb71..0000000000 --- a/spec/ruby/core/complex/comparision_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_relative '../../spec_helper' - -describe "Complex#<=>" do - ruby_version_is "2.7" do - it "returns nil if either self or argument has imaginary part" do - (Complex(5, 1) <=> Complex(2)).should be_nil - (Complex(1) <=> Complex(2, 1)).should be_nil - (5 <=> Complex(2, 1)).should be_nil - end - - it "returns nil if argument is not numeric" do - (Complex(5, 1) <=> "cmp").should be_nil - (Complex(1) <=> "cmp").should be_nil - (Complex(1) <=> Object.new).should be_nil - end - - it "returns 0, 1, or -1 if self and argument do not have imaginary part" do - (Complex(5) <=> Complex(2)).should == 1 - (Complex(2) <=> Complex(3)).should == -1 - (Complex(2) <=> Complex(2)).should == 0 - - (Complex(5) <=> 2).should == 1 - (Complex(2) <=> 3).should == -1 - (Complex(2) <=> 2).should == 0 - end - end -end diff --git a/spec/ruby/core/complex/comparison_spec.rb b/spec/ruby/core/complex/comparison_spec.rb new file mode 100644 index 0000000000..2a437afb71 --- /dev/null +++ b/spec/ruby/core/complex/comparison_spec.rb @@ -0,0 +1,27 @@ +require_relative '../../spec_helper' + +describe "Complex#<=>" do + ruby_version_is "2.7" do + it "returns nil if either self or argument has imaginary part" do + (Complex(5, 1) <=> Complex(2)).should be_nil + (Complex(1) <=> Complex(2, 1)).should be_nil + (5 <=> Complex(2, 1)).should be_nil + end + + it "returns nil if argument is not numeric" do + (Complex(5, 1) <=> "cmp").should be_nil + (Complex(1) <=> "cmp").should be_nil + (Complex(1) <=> Object.new).should be_nil + end + + it "returns 0, 1, or -1 if self and argument do not have imaginary part" do + (Complex(5) <=> Complex(2)).should == 1 + (Complex(2) <=> Complex(3)).should == -1 + (Complex(2) <=> Complex(2)).should == 0 + + (Complex(5) <=> 2).should == 1 + (Complex(2) <=> 3).should == -1 + (Complex(2) <=> 2).should == 0 + end + end +end diff --git a/spec/ruby/core/struct/values_at_spec.rb b/spec/ruby/core/struct/values_at_spec.rb index 7e517cdb4b..e7d287cba2 100644 --- a/spec/ruby/core/struct/values_at_spec.rb +++ b/spec/ruby/core/struct/values_at_spec.rb @@ -4,9 +4,9 @@ require_relative 'fixtures/classes' describe "Struct#values_at" do it "returns an array of values" do clazz = Struct.new(:name, :director, :year) - movie = clazz.new('Sympathy for Mr. Vengence', 'Chan-wook Park', 2002) - movie.values_at(0, 1).should == ['Sympathy for Mr. Vengence', 'Chan-wook Park'] - movie.values_at(0..2).should == ['Sympathy for Mr. Vengence', 'Chan-wook Park', 2002] + movie = clazz.new('Sympathy for Mr. Vengeance', 'Chan-wook Park', 2002) + movie.values_at(0, 1).should == ['Sympathy for Mr. Vengeance', 'Chan-wook Park'] + movie.values_at(0..2).should == ['Sympathy for Mr. Vengeance', 'Chan-wook Park', 2002] end it "fails when passed unsupported types" do -- cgit v1.2.3