Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build. Update recent specs of doc generator #7133

Merged
merged 1 commit into from
Dec 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions spec/compiler/crystal/tools/doc/generator_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ describe Doc::Generator do
describe "must_include_toplevel?" do
it "returns false if program has nothing" do
program = Program.new
generator = Doc::Generator.new program, ["foo"], ".", nil
generator = Doc::Generator.new program, ["foo"], ".", "html", nil
doc_type = Doc::Type.new generator, program

generator.must_include_toplevel?(doc_type).should be_false
end

it "returns true if program has constant" do
program = Program.new
generator = Doc::Generator.new program, ["foo"], ".", nil
generator = Doc::Generator.new program, ["foo"], ".", "html", nil
doc_type = Doc::Type.new generator, program

constant = Const.new program, program, "Foo", 1.int32
Expand All @@ -24,7 +24,7 @@ describe Doc::Generator do

it "returns false if program has constant which is defined in other place" do
program = Program.new
generator = Doc::Generator.new program, ["foo"], ".", nil
generator = Doc::Generator.new program, ["foo"], ".", "html", nil
doc_type = Doc::Type.new generator, program

constant = Const.new program, program, "Foo", 1.int32
Expand All @@ -36,7 +36,7 @@ describe Doc::Generator do

it "returns true if program has macro" do
program = Program.new
generator = Doc::Generator.new program, ["foo"], ".", nil
generator = Doc::Generator.new program, ["foo"], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo"
Expand All @@ -48,7 +48,7 @@ describe Doc::Generator do

it "returns false if program has macro which is defined in other place" do
program = Program.new
generator = Doc::Generator.new program, ["foo"], ".", nil
generator = Doc::Generator.new program, ["foo"], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo"
Expand All @@ -60,7 +60,7 @@ describe Doc::Generator do

it "returns true if program has method" do
program = Program.new
generator = Doc::Generator.new program, ["foo"], ".", nil
generator = Doc::Generator.new program, ["foo"], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo"
Expand All @@ -72,7 +72,7 @@ describe Doc::Generator do

it "returns false if program has method which is defined in other place" do
program = Program.new
generator = Doc::Generator.new program, ["foo"], ".", nil
generator = Doc::Generator.new program, ["foo"], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo"
Expand Down
22 changes: 11 additions & 11 deletions spec/compiler/crystal/tools/doc/macro_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe Doc::Macro do
describe "args_to_s" do
it "shows simple args" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg, "bar".arg]
Expand All @@ -14,7 +14,7 @@ describe Doc::Macro do

it "shows splat arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg], splat_index: 0
Expand All @@ -24,7 +24,7 @@ describe Doc::Macro do

it "shows simple arg and splat arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg, "bar".arg], splat_index: 1
Expand All @@ -34,7 +34,7 @@ describe Doc::Macro do

it "shows double splat arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", double_splat: "foo".arg
Expand All @@ -44,7 +44,7 @@ describe Doc::Macro do

it "shows double splat arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", double_splat: "foo".arg
Expand All @@ -54,7 +54,7 @@ describe Doc::Macro do

it "shows simple arg and double splat arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg], double_splat: "bar".arg
Expand All @@ -64,7 +64,7 @@ describe Doc::Macro do

it "shows block arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", block_arg: "foo".arg
Expand All @@ -74,7 +74,7 @@ describe Doc::Macro do

it "shows simple arg and block arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg], block_arg: "bar".arg
Expand All @@ -84,7 +84,7 @@ describe Doc::Macro do

it "shows external name of arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg(external_name: "bar")]
Expand All @@ -94,7 +94,7 @@ describe Doc::Macro do

it "shows external name of arg with quotes and escaping" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg(external_name: "<<-< uouo fish life")]
Expand All @@ -104,7 +104,7 @@ describe Doc::Macro do

it "shows default value with highlighting" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_macro = Macro.new "foo", ["foo".arg(default_value: 1.int32)]
Expand Down
22 changes: 11 additions & 11 deletions spec/compiler/crystal/tools/doc/method_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe Doc::Method do
describe "args_to_s" do
it "shows simple args" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", ["foo".arg, "bar".arg]
Expand All @@ -14,7 +14,7 @@ describe Doc::Method do

it "shows splat args" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", ["foo".arg], splat_index: 0
Expand All @@ -24,7 +24,7 @@ describe Doc::Method do

it "shows double splat args" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", double_splat: "foo".arg
Expand All @@ -34,7 +34,7 @@ describe Doc::Method do

it "shows block args" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", block_arg: "foo".arg
Expand All @@ -44,7 +44,7 @@ describe Doc::Method do

it "shows block args if a def has `yield`" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", yields: 1
Expand All @@ -54,7 +54,7 @@ describe Doc::Method do

it "shows return type restriction" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", return_type: "Foo".path
Expand All @@ -64,7 +64,7 @@ describe Doc::Method do

it "shows args and return type restriction" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", ["foo".arg], return_type: "Foo".path
Expand All @@ -74,7 +74,7 @@ describe Doc::Method do

it "shows external name of arg" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", ["foo".arg(external_name: "bar")]
Expand All @@ -84,7 +84,7 @@ describe Doc::Method do

it "shows external name of arg with quotes and escaping" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", ["foo".arg(external_name: "<<-< uouo fish life")]
Expand All @@ -94,7 +94,7 @@ describe Doc::Method do

it "shows typeof restriction of arg with highlighting" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", ["foo".arg(restriction: TypeOf.new([1.int32] of ASTNode))]
Expand All @@ -104,7 +104,7 @@ describe Doc::Method do

it "shows default value of arg with highlighting" do
program = Program.new
generator = Doc::Generator.new program, ["."], ".", nil
generator = Doc::Generator.new program, ["."], ".", "html", nil
doc_type = Doc::Type.new generator, program

a_def = Def.new "foo", ["foo".arg(default_value: 1.int32)]
Expand Down