Skip to content

Commit 24e13af

Browse files
committed
add a test case for #121
1 parent 6d0a36a commit 24e13af

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

spec/misc/getopt_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
end
113113

114114
# error cases
115-
context "running without any option nor argument" do
115+
context "without any option nor argument" do
116116
before(:each) { run_texdoc }
117117

118118
it 'should result in the "no action" error' do
@@ -140,6 +140,15 @@
140140
end
141141
end
142142

143+
context "missing arguments for Option -c, followed by other options" do
144+
before(:each) { run_texdoc "-c", "--help" }
145+
146+
it "should result in a getopt parser error" do
147+
expect(last_command_started).to have_exit_status(1)
148+
expect(stderr).to include(error_line "Option -c requires an argument.")
149+
end
150+
end
151+
143152
context "given an unknown option" do
144153
before(:each) { run_texdoc "-x" }
145154

0 commit comments

Comments
 (0)