Sha256: 6a6260de6d950ab5c17a45d3e24a245b2db1d700a1fe7aeb9f27e3984fa8c038

Contents?: true

Size: 898 Bytes

Versions: 9

Compression:

Stored size: 898 Bytes

Contents

require 'spec_helper'

TrelloCli::CLI::Commands::Test = Struct.new('Test')

describe TrelloCli::CLI::Commands::Shared do

  before do
    @object = TrelloCli::CLI::Commands::Test.new
    @object.extend TrelloCli::CLI::Commands::Shared
    @object.define_singleton_method(:test_action) { true }
  end

  it "should return a list of actions (instance methods)" do
    @object.actions.should == [:test_action]
  end

  it "should return the short name of the target class" do
    @object.target_name.should == 'test'
  end

  it "should return the shared methods" do
    @object.shared_methods.should == TrelloCli::CLI::Commands::Shared.instance_methods
  end

  it "should print help for a given target" do
    @object.should_receive(:puts).with('Valid commands for test: test_action')
    @object.should_receive(:puts).with('For further help, append -h to sub command.')
    @object.help
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trello_cli-0.5.0 spec/cli/commands/shared_spec.rb
trello_cli-0.4.1 spec/cli/commands/shared_spec.rb
trello_cli-0.4.0 spec/cli/commands/shared_spec.rb
trello_cli-0.3.0 spec/cli/commands/shared_spec.rb
trello_cli-0.2.1 spec/cli/commands/shared_spec.rb
trello_cli-0.2.0 spec/cli/commands/shared_spec.rb
trello_cli-0.1.0 spec/cli/commands/shared_spec.rb
trello_cli-0.0.4 spec/cli/commands/shared_spec.rb
trello_cli-0.0.3 spec/cli/commands/shared_spec.rb