Sha256: 44364fc893a94ab822bc04848a61051f093816bd2309c52d5c37d57dc7c39028

Contents?: true

Size: 884 Bytes

Versions: 29

Compression:

Stored size: 884 Bytes

Contents

require 'spec_helper'
require 'thegarage/gitx/cli/update_command'

describe Thegarage::Gitx::Cli::UpdateCommand do
  let(:args) { [] }
  let(:options) { {} }
  let(:config) do
    {
      pretend: true
    }
  end
  let(:cli) { Thegarage::Gitx::Cli::UpdateCommand.new(args, options, config) }
  let(:branch) { double('fake branch', name: 'feature-branch') }

  before do
    allow(cli).to receive(:current_branch).and_return(branch)
  end

  describe '#update' do
    before do
      allow(cli).to receive(:say)

      expect(cli).to receive(:run_cmd).with('git pull origin feature-branch', allow_failure: true).ordered
      expect(cli).to receive(:run_cmd).with('git pull origin master').ordered
      expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered

      cli.update
    end
    it 'runs expected commands' do
      should meet_expectations
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
thegarage-gitx-2.5.0 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.5.0.beta5 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.5.0.beta4 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.5.0.beta3 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.5.0.beta2 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.5.0.beta1 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.4.2 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.5.0.alpha1 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.4.1 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.4.0 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.4.0.pre1 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.3.0 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.3.0.pre1 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.2.3 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.2.3.pre2 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.2.3.pre1 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.2.2 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.2.1 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.2.0 spec/thegarage/gitx/cli/update_command_spec.rb
thegarage-gitx-2.1.1 spec/thegarage/gitx/cli/update_command_spec.rb