Skip to content

Commit

Permalink
Update spec messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Dec 29, 2024
1 parent 995202e commit 98572da
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/ameba/rule/typing/method_return_type_restriction_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module Ameba::Rule::Typing
CRYSTAL
end

it "passes if a private or protected method doesn't have a return type" do
it "passes if a private or protected method doesn't have a return type restriction" do
expect_no_issues subject, <<-CRYSTAL
private def hello
"hello world"
Expand All @@ -31,7 +31,7 @@ module Ameba::Rule::Typing
CRYSTAL
end

it "fails if a public method doesn't have a return type" do
it "fails if a public method doesn't have a return type restriction" do
expect_issue subject, <<-CRYSTAL
def hello
# ^^^^^^^ error: Method should have a return type restriction
Expand All @@ -45,7 +45,7 @@ module Ameba::Rule::Typing
rule = MethodReturnTypeRestriction.new
rule.private_methods = true

it "passes if a method has a return type" do
it "passes if a method has a return type restriction" do
expect_no_issues rule, <<-CRYSTAL
def hello : String
"hello world"
Expand All @@ -66,15 +66,15 @@ module Ameba::Rule::Typing
CRYSTAL
end

it "passes if a protected method doesn't have a return type" do
it "passes if a protected method doesn't have a return type restriction" do
expect_no_issues rule, <<-CRYSTAL
protected def hello
"hello world"
end
CRYSTAL
end

it "fails if a public or private method doesn't have a return type" do
it "fails if a public or private method doesn't have a return type restriction" do
expect_issue rule, <<-CRYSTAL
def hello
# ^^^^^^^ error: Method should have a return type restriction
Expand All @@ -93,23 +93,23 @@ module Ameba::Rule::Typing
rule = MethodReturnTypeRestriction.new
rule.protected_methods = true

it "passes if a method has a return type" do
it "passes if a method has a return type restriction" do
expect_no_issues rule, <<-CRYSTAL
protected def hello : String
"hello world"
end
CRYSTAL
end

it "passes if a private method doesn't have a return type" do
it "passes if a private method doesn't have a return type restriction" do
expect_no_issues rule, <<-CRYSTAL
private def hello
"hello world"
end
CRYSTAL
end

it "fails if a public or protected method doesn't have a return type" do
it "fails if a public or protected method doesn't have a return type restriction" do
expect_issue rule, <<-CRYSTAL
def hello
# ^^^^^^^ error: Method should have a return type restriction
Expand Down

0 comments on commit 98572da

Please sign in to comment.