Sha256: 7e86f8128ab934d0a5508262540ce3a97c3aa39a6980706e6bce5954f5870061
Contents?: true
Size: 849 Bytes
Versions: 25
Compression:
Stored size: 849 Bytes
Contents
require 'spec_helper' describe GithubCLI::Command do context '#all' do let(:task) { stub(:task, :name => 'create').as_null_object } let(:klass) { GithubCLI::Commands::Repositories } before do task.stub(:last) { task } end it "tracks all the commands in array" do Thor::Base.stub(:subclasses) { [klass, klass] } klass.stub(:tasks) { [task, task] } described_class.all.should have(4).items end it "skips help commands" do task_help = stub(:task, :name => 'help') task_help.stub(:last) { task_help } Thor::Base.stub(:subclasses) { [klass] } klass.stub(:tasks) { [task, task_help, task] } described_class.all.should have(2).items described_class.all.each do |cmd| cmd.name.should_not == 'help' end end end # all end # GithubCLI::Command
Version data entries
25 entries across 25 versions & 1 rubygems