Sha256: 3945440fa654a23ced163db5e5888550fd4bc27b0da286580db41c127dd83e26

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe StoryPullRequest do

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

  its(:cmd) { should =~ /open #{command.uri}/ }
  its(:cmd) { should =~ /git story-push/ }

  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 =~ /pull\/new/ }
    it { should_not =~ /\.git/ }
    it { should =~ /git story-push/ }

    describe "with a skip option" do
      subject { `bin/git-story-pull-request --skip --debug` }
      it { should_not =~ /git story-push/ }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pivotal-github-0.7.0 spec/commands/story_pull_request_spec.rb
pivotal-github-0.6.14 spec/commands/story_pull_request_spec.rb