Sha256: ca3e2e6bd4e3436eda475d2d259b0cf283547626d5f446b95d401cd7a619155c

Contents?: true

Size: 955 Bytes

Versions: 10

Compression:

Stored size: 955 Bytes

Contents

require 'spec_helper'

describe StoryPullRequest do

  let(:command) { StoryPullRequest.new }
  before { command.stub(:story_branch).and_return('62831853-tau-manifesto') }
  before do
    command.stub(:remote_location).
            and_return('https://github.com/mhartl/foo')
  end
  subject { command }

  its(:cmd) { should match /git pull-request/ }

  describe 'origin uri parsing' do
    let(:correct_origin) { 'https://github.com/mhartl/foo' }
    subject { command.send :origin_uri }

    context 'https protocol' do
      it { should eq correct_origin }
    end

    context 'git protocol' do
      before do
        command.stub(:remote_location).
                and_return('git@github.com:mhartl/foo')
      end

      it { should eq correct_origin }
    end
  end

  describe "command-line command" do
    subject { `bin/git-story-pull-request --debug` }
    it { should_not match /\.git/ }
    it { should match /git pull-request/ }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pivotal-github-1.0.6 spec/commands/story_pull_request_spec.rb
pivotal-github-1.0.5 spec/commands/story_pull_request_spec.rb
pivotal-github-1.0.4 spec/commands/story_pull_request_spec.rb
pivotal-github-1.0.3 spec/commands/story_pull_request_spec.rb
pivotal-github-1.0.2 spec/commands/story_pull_request_spec.rb
pivotal-github-1.0.1 spec/commands/story_pull_request_spec.rb
pivotal-github-1.0.0 spec/commands/story_pull_request_spec.rb
pivotal-github-0.9.1 spec/commands/story_pull_request_spec.rb
pivotal-github-0.9.0 spec/commands/story_pull_request_spec.rb
pivotal-github-0.8.1 spec/commands/story_pull_request_spec.rb