Sha256: d84c4f40b05262efe7c16b0c0b65427467872fcd9f379c40abd5de6630d55a61

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe StoryMerge do

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

  its(:cmd) { should match /git merge/ }

  shared_examples "story-merge with known options" do
    subject { command }
    it "should not raise an error" do
      expect { command.parse }.not_to raise_error(OptionParser::InvalidOption)
    end
  end

  describe "with no options" do
    its(:cmd) { should match /git checkout master/ }
    its(:cmd) { should match /git merge --no-ff --log #{command.story_branch}/ }
  end

  describe "with a custom development branch" do
    let(:command) { StoryMerge.new(['-d', 'develop']) }
    its(:cmd) { should match /git checkout develop/ }
  end

  describe "with some unknown options" do
    let(:command) { StoryMerge.new(['-d', 'develop', '-a', '-z', '--foo']) }
    it_should_behave_like "story-merge with known options"
    its(:cmd) { should match /-a -z --foo/ }
  end

  describe "command-line command" do
    subject { `bin/git-story-merge --debug -ff -d develop` }
    it { should match /git checkout develop/ }
    it { should match /git merge --no-ff --log -ff/ }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pivotal-github-0.8.1 spec/commands/story_merge_spec.rb