Sha256: 74ed60c59414c06f3600d4a2b39b2aa0dab4bd7b46442c94cd6ad2a1dcbaf0e5

Contents?: true

Size: 1.07 KB

Versions: 26

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

describe Command do
  let(:command) { Command.new }
  before { command.stub(:story_branch).and_return('62831853-tau-manifesto') }
  subject { command }

  it { should respond_to(:cmd) }
  it { should respond_to(:args) }
  it { should respond_to(:options) }
  it { should respond_to(:parse) }
  it { should respond_to(:story_id) }
  it { should respond_to(:story_ids) }

  its(:story_id)  { should eq  '62831853'  }
  its(:story_ids) { should eq ['62831853'] }

  describe "branches with multiple stories" do
    before do
      command.stub(:story_branch).and_return('62831853-tau-manifesto-31415926')
    end
    its(:story_ids) { should eq ['62831853', '31415926'] }
  end

  describe "when the branch name has other digit strings shorter than 8" do
    before { command.stub(:story_branch).and_return('3141592-62831853') }
    its(:story_id) { should eq '62831853' }
  end

  describe "with a story id with more than 8 digits" do
    before { command.stub(:story_branch).and_return('628318530-tau-manifesto') }
    its(:story_id) { should eq '628318530' }
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
pivotal-github-1.2.2 spec/commands/command_spec.rb
pivotal-github-1.2.0 spec/commands/command_spec.rb
pivotal-github-1.1.7 spec/commands/command_spec.rb
pivotal-github-1.1.6 spec/commands/command_spec.rb
pivotal-github-1.1.5 spec/commands/command_spec.rb
pivotal-github-1.1.4 spec/commands/command_spec.rb
pivotal-github-1.1.3 spec/commands/command_spec.rb
pivotal-github-1.1.2 spec/commands/command_spec.rb
pivotal-github-1.1.1 spec/commands/command_spec.rb
pivotal-github-1.1.0 spec/commands/command_spec.rb
pivotal-github-1.0.12 spec/commands/command_spec.rb
pivotal-github-1.0.11 spec/commands/command_spec.rb
pivotal-github-1.0.10 spec/commands/command_spec.rb
pivotal-github-1.0.9 spec/commands/command_spec.rb
pivotal-github-1.0.8 spec/commands/command_spec.rb
pivotal-github-1.0.7 spec/commands/command_spec.rb
pivotal-github-1.0.6 spec/commands/command_spec.rb
pivotal-github-1.0.5 spec/commands/command_spec.rb
pivotal-github-1.0.4 spec/commands/command_spec.rb
pivotal-github-1.0.3 spec/commands/command_spec.rb