Sha256: 9d5a6c0827b7d1b38871993ccc24507be3f302589dddb27aa58ef070d6371ecb
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require 'drbqs/command_line/command_line' describe DRbQS::Command::Base do context "when executing" do it "should execute." do setting = double('setting') DRbQS::Setting::Base.stub(:new).and_return(setting) setting.should_receive(:parse!) setting.should_receive(:exec).with($stdout) command_base = DRbQS::Command::Base.new(DRbQS::Setting::Base, 'help message') command_base.should_receive(:exit_normally) command_base.exec end it "should define DRbQS::Command::Base.exec." do argv = [1, 2, 3] obj = double DRbQS::Command::Base.should_receive(:new).and_return(obj) obj.should_receive(:parse_option) obj.should_receive(:exec) DRbQS::Command::Base.exec(argv) end end context "when existing" do subject do DRbQS::Command::Base.new end it "should exit with 0." do Kernel.should_receive(:exit).with(0) subject.__send__(:exit_normally) end it "should exit." do Kernel.should_receive(:exit) subject.__send__(:exit_unusually) end it "should exit." do Kernel.should_receive(:exit) subject.__send__(:exit_invalid_option) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
drbqs-0.1.1 | spec/command_line/command_base_spec.rb |
drbqs-0.1.0 | spec/command_line/command_base_spec.rb |