Sha256: 6e3484c216ff656660aef71ea5c60c74565e5ee71906523def1cabe8c3d7a103

Contents?: true

Size: 1.19 KB

Versions: 25

Compression:

Stored size: 1.19 KB

Contents

require "spec_helper"
require "octopolo/scripts/new_branch"

module Octopolo
  module Scripts
    describe NewBranch do
      let(:config) { stub(:config, :deploy_branch => "production") }
      let(:git) { stub(:Git) }
      let(:new_branch_name) { stub(:string) }
      let(:custom_source_branch) { stub(:string) }

      subject { NewBranch }

      before do
        NewBranch.any_instance.stub(:config => config, :git => git)
      end

      context "::execute" do
        context "with no arguments given" do
          it "fails if given no arguments" do
            expect { subject.execute }.to raise_error(ArgumentError)
          end
        end

        context "with a only new branch name given" do
          it "delegates to Git.new_branch" do
            git.should_receive(:new_branch).with(new_branch_name, "production")
            subject.execute(new_branch_name)
          end
        end

        context "with a only new branch name given" do
          it "delegates to Git.new_branch" do
            git.should_receive(:new_branch).with(new_branch_name, custom_source_branch)
            subject.execute(new_branch_name, custom_source_branch)
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
octopolo-1.2.1 spec/octopolo/scripts/new_branch_spec.rb
octopolo-1.2.0 spec/octopolo/scripts/new_branch_spec.rb
octopolo-1.1.1 spec/octopolo/scripts/new_branch_spec.rb
octopolo-1.1.0 spec/octopolo/scripts/new_branch_spec.rb
octopolo-1.0.2 spec/octopolo/scripts/new_branch_spec.rb
octopolo-1.0.1 spec/octopolo/scripts/new_branch_spec.rb
octopolo-1.0.0 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.4.1 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.4.0 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.3.6 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.3.5 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.3.4 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.3.3 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.3.2 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.3.1 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.3.0 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.2.1 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.1.4 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.2.0 spec/octopolo/scripts/new_branch_spec.rb
octopolo-0.1.3 spec/octopolo/scripts/new_branch_spec.rb