spec/cli/command_parser_spec.rb in yard-0.8.7.6 vs spec/cli/command_parser_spec.rb in yard-0.9.0
- old
+ new
@@ -1,43 +1,43 @@
require File.dirname(__FILE__) + '/../spec_helper'
describe YARD::CLI::CommandParser do
- describe '#run' do
+ describe "#run" do
before do
@cmd = CLI::CommandParser.new
end
- it "should show help if --help is provided" do
- command = mock(:command)
- command.should_receive(:run).with('--help')
+ it "shows help if --help is provided" do
+ command = double(:command)
+ expect(command).to receive(:run).with('--help')
CLI::CommandParser.commands[:foo] = command
@cmd.class.default_command = :foo
@cmd.run *%w( foo --help )
end
- it "should use default command if first argument is a switch" do
- command = mock(:command)
- command.should_receive(:run).with('--a', 'b', 'c')
+ it "uses default command if first argument is a switch" do
+ command = double(:command)
+ expect(command).to receive(:run).with('--a', 'b', 'c')
CLI::CommandParser.commands[:foo] = command
@cmd.class.default_command = :foo
@cmd.run *%w( --a b c )
end
- it "should use default command if no arguments are provided" do
- command = mock(:command)
- command.should_receive(:run)
+ it "uses default command if no arguments are provided" do
+ command = double(:command)
+ expect(command).to receive(:run)
CLI::CommandParser.commands[:foo] = command
@cmd.class.default_command = :foo
@cmd.run
end
- it "should list commands if command is not found" do
- @cmd.should_receive(:list_commands)
+ it "lists commands if command is not found" do
+ expect(@cmd).to receive(:list_commands)
@cmd.run *%w( unknown_command --args )
end
- it "should list commands if --help is provided as sole argument" do
- @cmd.should_receive(:list_commands)
+ it "lists commands if --help is provided as sole argument" do
+ expect(@cmd).to receive(:list_commands)
@cmd.run *%w( --help )
end
end
end
\ No newline at end of file