Sha256: ab59aeb38dfed626c67860e9d176b6085121927a9a92d9037c16e990c153fe7d

Contents?: true

Size: 1.03 KB

Versions: 20

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe StoryPush do

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

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

  shared_examples "story-push 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 push origin #{command.story_branch}" }
  end

  describe "with a target option" do
    let(:command) { StoryPush.new(['-t', 'heroku']) }
    its(:cmd) { should =~ /git push heroku/ }
  end

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

  describe "command-line command" do
    subject { `bin/git-story-push --debug -z -t heroku` }
    it { should =~ /git push -z heroku/ }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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