Skip to content

Commit

Permalink
Update spec names, add case/enum spec
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Jun 13, 2024
1 parent f1bb8a7 commit 7f53f1c
Showing 1 changed file with 35 additions and 17 deletions.
52 changes: 35 additions & 17 deletions spec/compiler/crystal/tools/documentation_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe "documentation" do
)
end

it "find implementation from macro expansions" do
it "find documentation from macro expansions" do
assert_documentation %(
macro foo
# ༓bar docs
Expand Down Expand Up @@ -237,7 +237,7 @@ describe "documentation" do
end.should eq %({"status":"ok","message":"1 doc comment found","documentations":[["bar docs",".:5:9"]]})
end

it "find implementation in class methods" do
it "find documentation of class methods" do
assert_documentation %(
# ༓Hello world
def foo
Expand All @@ -253,7 +253,7 @@ describe "documentation" do
Bar.bar)
end

it "find implementation in generic class" do
it "find documentation of generic class" do
assert_documentation %(
class Foo
# ༓Foo stuff
Expand All @@ -278,7 +278,7 @@ describe "documentation" do
)
end

it "find implementation in generic class methods" do
it "find documentation of generic class methods" do
assert_documentation %(
# ༓Hello world
def foo
Expand All @@ -294,7 +294,7 @@ describe "documentation" do
)
end

it "find implementation inside a module class" do
it "find documentation inside a module class" do
assert_documentation %(
# ༓Hello world
def foo
Expand All @@ -312,7 +312,7 @@ describe "documentation" do
)
end

it "find implementation inside contained class' class method" do
it "find documentation inside contained class' class method" do
assert_documentation %(
# ༓Hello world
def foo
Expand All @@ -331,7 +331,7 @@ describe "documentation" do
)
end

it "find implementation inside contained file private method" do
it "find documentation inside contained file private method" do
assert_documentation %(
# ༓Hello world
private def foo
Expand All @@ -345,7 +345,7 @@ describe "documentation" do
)
end

it "find implementation inside contained file private class' class method" do
it "find documentation inside contained file private class' class method" do
assert_documentation %(
# ༓Hello world
private def foo
Expand All @@ -361,7 +361,7 @@ describe "documentation" do
)
end

it "find class implementation" do
it "find class documentation" do
assert_documentation %(
# ༓Foo docs
class Foo
Expand Down Expand Up @@ -391,7 +391,7 @@ describe "documentation" do
)
end

it "find struct implementation" do
it "find struct documentation" do
assert_documentation %(
# ༓Foo docs
struct Foo
Expand All @@ -401,7 +401,7 @@ describe "documentation" do
)
end

it "find module implementation" do
it "find module documentation" do
assert_documentation %(
# ༓Foo docs
module Foo
Expand All @@ -411,7 +411,7 @@ describe "documentation" do
)
end

it "find enum implementation" do
it "find enum documentation" do
assert_documentation %(
# ༓Foo docs
enum Foo
Expand All @@ -422,7 +422,7 @@ describe "documentation" do
)
end

it "find enum value implementation" do
it "find enum value documentation" do
assert_documentation %(
enum Foo
# ༓Foo docs
Expand All @@ -433,7 +433,25 @@ describe "documentation" do
)
end

it "find alias implementation" do
it "find enum value documentation in case" do
assert_documentation %(
enum Foo
# ༓Foo docs
Foo
# Bar docs
Bar
end
a : Foo = Foo::Bar
case a
in Foo::F‸oo
in Foo::Bar
end
)
end

it "find alias documentation" do
assert_documentation %(
class Foo
end
Expand All @@ -445,7 +463,7 @@ describe "documentation" do
)
end

it "find class defined by macro" do
it "find class documentation defined by macro" do
assert_documentation %(
macro foo
# ༓foo docs
Expand All @@ -459,7 +477,7 @@ describe "documentation" do
), check_lines: false
end

it "find class inside method" do
it "find class documentation inside method" do
assert_documentation %(
# ༓Foo docs
class Foo
Expand All @@ -473,7 +491,7 @@ describe "documentation" do
)
end

it "find const implementation" do
it "find const documentation" do
assert_documentation %(
# ༓Foo docs
Foo = 42
Expand Down

0 comments on commit 7f53f1c

Please sign in to comment.