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

Version Path
github_cli-0.6.2 spec/github_cli/command_spec.rb
github_cli-0.6.1 spec/github_cli/command_spec.rb
github_cli-0.6.0 spec/github_cli/command_spec.rb
github_cli-0.5.9 spec/github_cli/command_spec.rb
github_cli-0.5.8 spec/github_cli/command_spec.rb
github_cli-0.5.7 spec/github_cli/command_spec.rb
github_cli-0.5.6 spec/github_cli/command_spec.rb
github_cli-0.5.5 spec/github_cli/command_spec.rb
github_cli-0.5.4 spec/github_cli/command_spec.rb
github_cli-0.5.3 spec/github_cli/command_spec.rb
github_cli-0.5.2 spec/github_cli/command_spec.rb
github_cli-0.5.1 spec/github_cli/command_spec.rb
github_cli-0.5.0 spec/github_cli/command_spec.rb
github_cli-0.4.4 spec/github_cli/command_spec.rb
github_cli-0.4.3 spec/github_cli/command_spec.rb
github_cli-0.4.2 spec/github_cli/command_spec.rb
github_cli-0.4.1 spec/github_cli/command_spec.rb
github_cli-0.4.0 spec/github_cli/command_spec.rb
github_cli-0.3.1 spec/github_cli/command_spec.rb
github_cli-0.3.0 spec/github_cli/command_spec.rb