Sha256: 9b013f566ca0b7e6c298f7fec5710e8f02358a86230c165b5c656e2946290b0e

Contents?: true

Size: 1.17 KB

Versions: 13

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe StoryMerge do

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

  its(:cmd) { should =~ /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 =~ /git checkout master/ }
    its(:cmd) { should =~ /git merge --no-ff --log #{command.story_branch}/ }
  end

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

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

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pivotal-github-0.7.0 spec/commands/story_merge_spec.rb
pivotal-github-0.6.14 spec/commands/story_merge_spec.rb
pivotal-github-0.6.12 spec/commands/story_merge_spec.rb
pivotal-github-0.6.11 spec/commands/story_merge_spec.rb
pivotal-github-0.6.10 spec/commands/story_merge_spec.rb
pivotal-github-0.6.9 spec/commands/story_merge_spec.rb
pivotal-github-0.6.8 spec/commands/story_merge_spec.rb
pivotal-github-0.6.7 spec/commands/story_merge_spec.rb
pivotal-github-0.6.6 spec/commands/story_merge_spec.rb
pivotal-github-0.6.5 spec/commands/story_merge_spec.rb
pivotal-github-0.6.4 spec/commands/story_merge_spec.rb
pivotal-github-0.6.3 spec/commands/story_merge_spec.rb
pivotal-github-0.6.2 spec/commands/story_merge_spec.rb