@@ -65,4 +65,55 @@ defmodule ExDoc.CLITest do
65
65
66
66
assert catch_exit ( capture_io ( fun ) ) == { :shutdown , 1 }
67
67
end
68
+
69
+ test "arguments that are not aliased" do
70
+ File . write! ( "not_aliased.config" , ~s( [extra: "README2.md"]) )
71
+
72
+ args = [
73
+ "ExDoc" , "1.2.3" , "ebin" ,
74
+ "--config" , "not_aliased.config" ,
75
+ "--output" , "html" ,
76
+ "--formatter" , "html" ,
77
+ "--filter-prefix" , "prefix_" ,
78
+ "--source-root" , "./" ,
79
+ "--source-url" , "http://example.com/username/project" ,
80
+ "--source-ref" , "abcdefg" ,
81
+ "--main" , "Main" ,
82
+ "--homepage-url" , "http://example.com" ,
83
+ "--extra" , "README.md" , "--extra" , "Foo" , "--extra" , "Bar" ,
84
+ "--extra-section" , "Extra" ,
85
+ "--assets" , "foo.css" ,
86
+ "--logo" , "logo.png" ,
87
+ "--canonical" , "http://example.com/project" ,
88
+
89
+ # invalid options
90
+ "--nonexistant" ,
91
+ "--non_existant" ,
92
+ "--idontexist" , "baz" ,
93
+ "--i_dont_exist" , "baz" ,
94
+ ]
95
+
96
+ { project , version , opts } = run ( args )
97
+ assert project == "ExDoc"
98
+ assert version == "1.2.3"
99
+ assert Enum . sort ( opts ) == [
100
+ assets: "foo.css" ,
101
+ canonical: "http://example.com/project" ,
102
+ extra_section: "Extra" ,
103
+ extras: [ "README.md" , "Foo" , "Bar" ] ,
104
+ filter_prefix: "prefix_" ,
105
+ formatter: "html" ,
106
+ formatter_opts: [ extra: "README2.md" ] ,
107
+ homepage_url: "http://example.com" ,
108
+ logo: "logo.png" ,
109
+ main: "Main" ,
110
+ output: "html" ,
111
+ source_beam: "ebin" ,
112
+ source_ref: "abcdefg" ,
113
+ source_root: "./" ,
114
+ source_url: "http://example.com/username/project" ,
115
+ ]
116
+ after
117
+ File . rm! ( "not_aliased.config" )
118
+ end
68
119
end
0 commit comments