Sha256: 2f527c125abffab1c8aa136ddb51a6ffa0f8ad25faa8d3c1957d4b05ce72bae7

Contents?: true

Size: 1.17 KB

Versions: 20

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe StoryPull do

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

  its(:cmd) { should =~ /git pull/ }

  shared_examples "story-pull 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 pull/ }
    its(:cmd) { should =~ /git checkout #{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-pull with known options"
    its(:cmd) { should =~ /git pull -a -z --foo/ }
  end

  describe "command-line command" do
    subject { `bin/git-story-pull --debug -z -d develop` }
    it { should =~ /git checkout develop/ }
    it { should =~ /git pull -z/ }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pivotal-github-0.7.0 spec/commands/story_pull_spec.rb
pivotal-github-0.6.14 spec/commands/story_pull_spec.rb
pivotal-github-0.6.12 spec/commands/story_pull_spec.rb
pivotal-github-0.6.11 spec/commands/story_pull_spec.rb
pivotal-github-0.6.10 spec/commands/story_pull_spec.rb
pivotal-github-0.6.9 spec/commands/story_pull_spec.rb
pivotal-github-0.6.8 spec/commands/story_pull_spec.rb
pivotal-github-0.6.7 spec/commands/story_pull_spec.rb
pivotal-github-0.6.6 spec/options/story_pull_spec.rb
pivotal-github-0.6.5 spec/options/story_pull_spec.rb
pivotal-github-0.6.4 spec/options/story_pull_spec.rb
pivotal-github-0.6.3 spec/options/story_pull_spec.rb
pivotal-github-0.6.2 spec/options/story_pull_spec.rb
pivotal-github-0.6.1 spec/options/story_pull_spec.rb
pivotal-github-0.6.0 spec/options/story_pull_spec.rb
pivotal-github-0.5.6 spec/options/story_pull_spec.rb
pivotal-github-0.5.5 spec/options/story_pull_spec.rb
pivotal-github-0.5.4 spec/options/story_pull_spec.rb
pivotal-github-0.5.3 spec/options/story_pull_spec.rb
pivotal-github-0.5.2 spec/options/story_pull_spec.rb