Sha256: a0af1d4254d3973464080a3c5ece03cb8b889c370f3672281622651af33eb0ac

Contents?: true

Size: 1.1 KB

Versions: 23

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe MergeBranch do

  let(:command) { MergeBranch.new }
  before { command.stub(:current_branch).and_return('tau-manifesto') }
  subject { command }

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

  shared_examples "merge-branch 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/ }
  end

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

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

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
git-utils-1.0.0 spec/commands/merge_branch_spec.rb
git-utils-0.7.1 spec/commands/merge_branch_spec.rb
git-utils-0.7.0 spec/commands/merge_branch_spec.rb
git-utils-0.6.5 spec/commands/merge_branch_spec.rb
git-utils-0.6.4 spec/commands/merge_branch_spec.rb
git-utils-0.6.3 spec/commands/merge_branch_spec.rb
git-utils-0.6.2 spec/commands/merge_branch_spec.rb
git-utils-0.6.1 spec/commands/merge_branch_spec.rb
git-utils-0.6.0 spec/commands/merge_branch_spec.rb
git-utils-0.5.10 spec/commands/merge_branch_spec.rb
git-utils-0.5.9 spec/commands/merge_branch_spec.rb
git-utils-0.5.8 spec/commands/merge_branch_spec.rb
git-utils-0.5.7 spec/commands/merge_branch_spec.rb
git-utils-0.5.6 spec/commands/merge_branch_spec.rb
git-utils-0.5.5 spec/commands/merge_branch_spec.rb
git-utils-0.5.4 spec/commands/merge_branch_spec.rb
git-utils-0.5.3 spec/commands/merge_branch_spec.rb
git-utils-0.5.2 spec/commands/merge_branch_spec.rb
git-utils-0.5.1 spec/commands/merge_branch_spec.rb
git-utils-0.5.0 spec/commands/merge_branch_spec.rb