spec/unit/cli_spec.rb in qcmd-0.1.14 vs spec/unit/cli_spec.rb in qcmd-0.1.15
- old
+ new
@@ -1,19 +1,22 @@
require 'qcmd'
-describe Qcmd::CLI do
- it "should call `start` when initialized" do
- Qcmd::CLI.any_instance.stub(:start) { true }
- Qcmd::CLI.any_instance.should_receive(:start)
- Qcmd::CLI.new
+class NonStarter
+ def start
end
+end
- it 'should respond to launch' do
+describe Qcmd::CLI do
+ it 'should init on launch' do
+ Qcmd::CLI.stub(:new) { NonStarter.new }
Qcmd::CLI.should_receive :new
Qcmd::CLI.launch
end
- describe 'handling input' do
- it 'should evaluate cue commands' do
+ describe 'replace_args' do
+ it 'should replace args in alias expression with values of given type' do
+ cli = Qcmd::CLI.new
+ new_command = cli.replace_args [:cue, :'$1', :name, "hello $2"], [:at, 2, 3]
+ new_command.should eql([:cue, 2, :name, "hello 3"])
end
end
end