Skip to content

Commit 089c30e

Browse files
committed
failing tests for running help command with required class options
1 parent e5e77c4 commit 089c30e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/thor_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,23 @@ def shell
422422
expect(capture(:stdout) { MyScript.start(%w[help foo]) }).to match(/Usage:/)
423423
end
424424
end
425+
426+
context "with required class_options" do
427+
let(:klass) do
428+
Class.new(Thor) do
429+
class_option :foo, :required => true
430+
431+
desc "bar", "do something"
432+
def bar
433+
end
434+
end
435+
end
436+
437+
it "shows the command help" do
438+
content = capture(:stdout) { klass.start(%w{help}) }
439+
expect(content).to match(/Commands:/)
440+
end
441+
end
425442
end
426443

427444
describe "when creating commands" do

0 commit comments

Comments
 (0)